home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: LaTeX Document
(document/latex).
You can browse this item here: blit.tex
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LaTeX Document (document/latex)
| magic
| Supported |
99%
| dexvert
| Texinfo Document (document/texInfo)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| LaTeX document text
| default
| |
99%
| file
| TeX document text
| default
| |
98%
| file
| LaTeX auxiliary file, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| x-fmt/111 Plain Text File
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 25 0a 25 20 20 20 42 6c | 69 74 74 65 72 20 6d 61 |%.% Bl|itter ma|
|00000010| 6e 75 61 6c 0a 25 0a 5c | 69 6e 70 75 74 20 62 6c |nual.%.\|input bl|
|00000020| 69 74 6d 61 63 0a 25 0a | 7b 5c 6c 65 74 5c 74 65 |itmac.%.|{\let\te|
|00000030| 78 74 69 6e 64 65 6e 74 | 3d 5c 72 65 6c 61 78 0a |xtindent|=\relax.|
|00000040| 5c 66 6f 6f 74 6e 6f 74 | 65 7b 7d 7b 5c 76 62 6f |\footnot|e{}{\vbo|
|00000050| 78 7b 5c 73 6d 5c 62 61 | 73 65 6c 69 6e 65 73 6b |x{\sm\ba|selinesk|
|00000060| 69 70 3d 39 70 74 5c 6e | 6f 69 6e 64 65 6e 74 0a |ip=9pt\n|oindent.|
|00000070| 43 6f 70 79 72 69 67 68 | 74 20 5c 63 6f 70 79 72 |Copyrigh|t \copyr|
|00000080| 69 67 68 74 5c 20 31 39 | 38 38 20 62 79 20 52 61 |ight\ 19|88 by Ra|
|00000090| 64 69 63 61 6c 20 45 79 | 65 20 53 6f 66 74 77 61 |dical Ey|e Softwa|
|000000a0| 72 65 2c 20 42 6f 78 20 | 32 30 38 31 2c 0a 53 74 |re, Box |2081,.St|
|000000b0| 61 6e 66 6f 72 64 2c 20 | 43 41 5c 20 5c 20 39 34 |anford, |CA\ \ 94|
|000000c0| 33 30 39 2e 20 20 41 6c | 6c 20 52 69 67 68 74 73 |309. Al|l Rights|
|000000d0| 20 52 65 73 65 72 76 65 | 64 2e 0a 45 76 65 72 79 | Reserve|d..Every|
|000000e0| 20 65 66 66 6f 72 74 20 | 68 61 73 20 62 65 65 6e | effort |has been|
|000000f0| 20 6d 61 64 65 20 74 6f | 20 73 75 70 70 6c 79 20 | made to| supply |
|00000100| 63 6f 6d 70 6c 65 74 65 | 20 61 6e 64 20 61 63 63 |complete| and acc|
|00000110| 75 72 61 74 65 20 69 6e | 66 6f 72 6d 61 74 69 6f |urate in|formatio|
|00000120| 6e 2e 0a 48 6f 77 65 76 | 65 72 2c 20 52 61 64 69 |n..Howev|er, Radi|
|00000130| 63 61 6c 20 45 79 65 20 | 53 6f 66 74 77 61 72 65 |cal Eye |Software|
|00000140| 20 61 6e 64 20 54 6f 6d | 61 73 20 52 6f 6b 69 63 | and Tom|as Rokic|
|00000150| 6b 69 20 61 73 73 75 6d | 65 20 6e 6f 20 72 65 73 |ki assum|e no res|
|00000160| 70 6f 6e 73 69 62 69 6c | 69 74 79 0a 66 6f 72 20 |ponsibil|ity.for |
|00000170| 69 74 73 20 75 73 65 2c | 20 6e 6f 72 20 66 6f 72 |its use,| nor for|
|00000180| 20 61 6e 79 20 69 6e 66 | 72 69 6e 67 65 6d 65 6e | any inf|ringemen|
|00000190| 74 73 20 6f 66 20 70 61 | 74 65 6e 74 73 20 6f 72 |ts of pa|tents or|
|000001a0| 20 6f 74 68 65 72 20 72 | 69 67 68 74 73 20 6f 66 | other r|ights of|
|000001b0| 0a 74 68 69 72 64 20 70 | 61 72 74 69 65 73 20 77 |.third p|arties w|
|000001c0| 68 69 63 68 20 77 6f 75 | 6c 64 20 72 65 73 75 6c |hich wou|ld resul|
|000001d0| 74 2e 7d 7d 7d 0a 5c 66 | 6f 6f 74 6c 69 6e 65 3d |t.}}}.\f|ootline=|
|000001e0| 7b 5c 68 73 73 5c 74 65 | 6e 72 6d 20 42 6c 69 74 |{\hss\te|nrm Blit|
|000001f0| 74 65 72 2d 2d 2d 5c 66 | 6f 6c 69 6f 5c 68 73 73 |ter---\f|olio\hss|
|00000200| 7d 0a 5c 76 73 6b 69 70 | 20 31 69 6e 0a 5c 63 65 |}.\vskip| 1in.\ce|
|00000210| 6e 74 65 72 6c 69 6e 65 | 7b 5c 42 62 66 20 42 6c |nterline|{\Bbf Bl|
|00000220| 69 74 4c 61 62 20 61 6e | 64 20 74 68 65 20 41 6d |itLab an|d the Am|
|00000230| 69 67 61 20 42 6c 69 74 | 74 65 72 7d 0a 5c 6d 65 |iga Blit|ter}.\me|
|00000240| 64 73 6b 69 70 5c 6d 65 | 64 73 6b 69 70 0a 5c 63 |dskip\me|dskip.\c|
|00000250| 65 6e 74 65 72 6c 69 6e | 65 7b 54 6f 6d 61 73 20 |enterlin|e{Tomas |
|00000260| 52 6f 6b 69 63 6b 69 7d | 0a 5c 6d 65 64 73 6b 69 |Rokicki}|.\medski|
|00000270| 70 0a 5c 63 65 6e 74 65 | 72 6c 69 6e 65 7b 5c 76 |p.\cente|rline{\v|
|00000280| 62 6f 78 7b 5c 72 61 64 | 65 79 65 6c 6f 67 6f 7d |box{\rad|eyelogo}|
|00000290| 7d 0a 5c 6d 65 64 73 6b | 69 70 0a 5c 63 65 6e 74 |}.\medsk|ip.\cent|
|000002a0| 65 72 6c 69 6e 65 7b 31 | 33 20 41 70 72 69 6c 20 |erline{1|3 April |
|000002b0| 31 39 38 38 7d 0a 5c 76 | 62 5c 76 62 5c 76 62 0a |1988}.\v|b\vb\vb.|
|000002c0| 0a 54 68 69 73 20 6d 61 | 6e 75 61 6c 20 77 69 6c |.This ma|nual wil|
|000002d0| 6c 20 6e 6f 74 20 6d 61 | 6b 65 20 6d 75 63 68 20 |l not ma|ke much |
|000002e0| 73 65 6e 73 65 20 77 69 | 74 68 6f 75 74 20 61 20 |sense wi|thout a |
|000002f0| 77 6f 72 6b 69 6e 67 20 | 63 6f 70 79 20 6f 66 20 |working |copy of |
|00000300| 42 6c 69 74 4c 61 62 20 | 31 2e 33 2c 0a 61 73 20 |BlitLab |1.3,.as |
|00000310| 6d 6f 73 74 20 6f 66 20 | 74 68 65 20 64 6f 63 75 |most of |the docu|
|00000320| 6d 65 6e 74 61 74 69 6f | 6e 20 69 73 20 69 6e 20 |mentatio|n is in |
|00000330| 74 68 65 20 65 78 61 6d | 70 6c 65 73 20 70 72 6f |the exam|ples pro|
|00000340| 76 69 64 65 64 2e 20 20 | 46 6f 72 20 61 20 66 72 |vided. |For a fr|
|00000350| 65 65 20 63 6f 70 79 2c | 0a 69 6e 63 6c 75 64 69 |ee copy,|.includi|
|00000360| 6e 67 20 73 6f 75 72 63 | 65 2c 20 73 69 6d 70 6c |ng sourc|e, simpl|
|00000370| 79 20 77 72 69 74 65 20 | 74 6f 20 54 6f 6d 61 73 |y write |to Tomas|
|00000380| 20 52 6f 6b 69 63 6b 69 | 2c 20 42 6f 78 20 32 30 | Rokicki|, Box 20|
|00000390| 38 31 2c 0a 53 74 61 6e | 66 6f 72 64 2c 20 43 41 |81,.Stan|ford, CA|
|000003a0| 5c 20 5c 20 39 34 33 30 | 39 2e 20 20 41 20 66 65 |\ \ 9430|9. A fe|
|000003b0| 77 20 62 75 63 6b 73 20 | 66 6f 72 20 66 6c 6f 70 |w bucks |for flop|
|000003c0| 70 69 65 73 20 61 6e 64 | 20 70 6f 73 74 61 67 65 |pies and| postage|
|000003d0| 20 77 6f 75 6c 64 20 62 | 65 20 6e 69 63 65 2c 0a | would b|e nice,.|
|000003e0| 62 75 74 20 6e 6f 74 20 | 6e 65 63 65 73 73 61 72 |but not |necessar|
|000003f0| 79 2e 0a 0a 5c 73 65 63 | 74 69 6f 6e 20 49 6e 74 |y...\sec|tion Int|
|00000400| 72 6f 64 75 63 74 69 6f | 6e 5c 5c 0a 0a 53 6f 20 |roductio|n\\..So |
|00000410| 79 6f 75 20 68 61 76 65 | 20 70 6f 72 65 64 20 6f |you have| pored o|
|00000420| 76 65 72 20 74 68 65 20 | 48 61 72 64 77 61 72 65 |ver the |Hardware|
|00000430| 20 4d 61 6e 75 61 6c 20 | 61 6e 64 20 74 68 65 20 | Manual |and the |
|00000440| 52 4f 4d 20 4b 65 72 6e | 65 6c 20 4d 61 6e 75 61 |ROM Kern|el Manua|
|00000450| 6c 2c 20 61 6e 64 0a 79 | 6f 75 20 63 61 6e 6e 6f |l, and.y|ou canno|
|00000460| 74 20 66 69 6e 64 20 74 | 68 65 20 69 6e 66 6f 72 |t find t|he infor|
|00000470| 6d 61 74 69 6f 6e 20 79 | 6f 75 20 6e 65 65 64 20 |mation y|ou need |
|00000480| 6f 6e 20 74 68 65 20 62 | 6c 69 74 74 65 72 2e 20 |on the b|litter. |
|00000490| 20 57 65 6c 6c 2c 20 6e | 65 76 65 72 0a 66 65 61 | Well, n|ever.fea|
|000004a0| 72 3b 20 61 6c 6c 20 74 | 68 65 20 69 6e 66 6f 72 |r; all t|he infor|
|000004b0| 6d 61 74 69 6f 6e 20 79 | 6f 75 20 73 68 6f 75 6c |mation y|ou shoul|
|000004c0| 64 20 65 76 65 72 20 6e | 65 65 64 20 61 62 6f 75 |d ever n|eed abou|
|000004d0| 74 20 74 68 65 20 62 6c | 69 74 74 65 72 20 69 73 |t the bl|itter is|
|000004e0| 0a 63 6f 6e 74 61 69 6e | 65 64 20 69 6e 20 74 68 |.contain|ed in th|
|000004f0| 69 73 20 6f 6e 65 20 68 | 61 6e 64 79 20 64 6f 63 |is one h|andy doc|
|00000500| 75 6d 65 6e 74 2e 0a 0a | 41 6c 6c 20 69 6e 66 6f |ument...|All info|
|00000510| 72 6d 61 74 69 6f 6e 20 | 62 65 6c 6f 77 20 77 61 |rmation |below wa|
|00000520| 73 20 64 65 72 69 76 65 | 64 20 66 72 6f 6d 20 74 |s derive|d from t|
|00000530| 68 65 20 48 61 72 64 77 | 61 72 65 20 4d 61 6e 75 |he Hardw|are Manu|
|00000540| 61 6c 2c 20 52 4f 4d 20 | 4b 65 72 6e 65 6c 0a 4d |al, ROM |Kernel.M|
|00000550| 61 6e 75 61 6c 2c 20 74 | 68 65 20 52 4f 4d 27 73 |anual, t|he ROM's|
|00000560| 2c 20 61 6e 64 20 61 20 | 6c 6f 74 20 6f 66 20 65 |, and a |lot of e|
|00000570| 6d 70 69 72 69 63 61 6c | 20 74 65 73 74 69 6e 67 |mpirical| testing|
|00000580| 2e 20 20 55 73 69 6e 67 | 20 74 68 65 20 62 6c 69 |. Using| the bli|
|00000590| 74 74 65 72 20 64 69 72 | 65 63 74 6c 79 2c 0a 61 |tter dir|ectly,.a|
|000005a0| 73 20 64 65 73 63 72 69 | 62 65 64 20 69 6e 20 74 |s descri|bed in t|
|000005b0| 68 69 73 20 72 65 70 6f | 72 74 2c 20 68 6f 77 65 |his repo|rt, howe|
|000005c0| 76 65 72 2c 20 62 79 70 | 61 73 73 65 73 20 74 68 |ver, byp|asses th|
|000005d0| 65 20 6c 61 79 65 72 73 | 20 6c 69 62 72 61 72 79 |e layers| library|
|000005e0| 2e 0a 49 66 20 79 6f 75 | 20 77 61 6e 74 20 74 6f |..If you| want to|
|000005f0| 20 75 73 65 20 74 68 65 | 73 65 20 74 65 63 68 6e | use the|se techn|
|00000600| 69 71 75 65 73 20 66 6f | 72 20 67 72 61 70 68 69 |iques fo|r graphi|
|00000610| 63 73 2c 0a 6f 70 65 6e | 20 79 6f 75 72 20 6f 77 |cs,.open| your ow|
|00000620| 6e 20 63 75 73 74 6f 6d | 20 73 63 72 65 65 6e 3b |n custom| screen;|
|00000630| 20 69 66 20 79 6f 75 20 | 6f 70 65 6e 20 61 6e 79 | if you |open any|
|00000640| 20 77 69 6e 64 6f 77 73 | 20 6f 6e 20 74 68 69 73 | windows| on this|
|00000650| 20 73 63 72 65 65 6e 2c | 0a 62 65 20 63 61 72 65 | screen,|.be care|
|00000660| 66 75 6c 20 74 6f 20 6e | 6f 74 20 64 65 73 74 72 |ful to n|ot destr|
|00000670| 6f 79 20 74 68 65 20 67 | 72 61 70 68 69 63 73 20 |oy the g|raphics |
|00000680| 72 65 6e 64 65 72 65 64 | 20 62 79 20 49 6e 74 75 |rendered| by Intu|
|00000690| 69 74 69 6f 6e 2e 0a 4f | 72 2c 20 64 6f 20 79 6f |ition..O|r, do yo|
|000006a0| 75 72 20 67 72 61 70 68 | 69 63 73 20 69 6e 20 61 |ur graph|ics in a|
|000006b0| 6e 20 6f 66 66 2d 73 63 | 72 65 65 6e 20 62 69 74 |n off-sc|reen bit|
|000006c0| 6d 61 70 2c 20 61 6e 64 | 20 62 6c 61 73 74 20 69 |map, and| blast i|
|000006d0| 74 20 69 6e 74 6f 20 79 | 6f 75 72 0a 77 69 6e 64 |t into y|our.wind|
|000006e0| 6f 77 73 20 70 65 72 69 | 6f 64 69 63 61 6c 6c 79 |ows peri|odically|
|000006f0| 2e 0a 0a 5c 73 65 63 74 | 69 6f 6e 20 54 68 65 20 |...\sect|ion The |
|00000700| 48 61 72 64 77 61 72 65 | 5c 5c 0a 0a 54 68 65 20 |Hardware|\\..The |
|00000710| 62 6c 69 74 74 65 72 20 | 63 6f 6d 70 72 69 73 65 |blitter |comprise|
|00000720| 73 20 70 61 72 74 20 6f | 66 20 74 68 65 20 41 67 |s part o|f the Ag|
|00000730| 6e 65 73 20 63 68 69 70 | 20 69 6e 20 74 68 65 20 |nes chip| in the |
|00000740| 41 6d 69 67 61 2c 20 61 | 6e 64 20 63 61 6e 20 6f |Amiga, a|nd can o|
|00000750| 6e 6c 79 0a 61 63 63 65 | 73 73 20 43 48 49 50 20 |nly.acce|ss CHIP |
|00000760| 6d 65 6d 6f 72 79 2e 20 | 20 28 43 48 49 50 20 6d |memory. | (CHIP m|
|00000770| 65 6d 6f 72 79 20 69 73 | 20 74 68 65 20 6c 6f 77 |emory is| the low|
|00000780| 65 72 20 35 31 32 4b 20 | 6f 66 20 6d 65 6d 6f 72 |er 512K |of memor|
|00000790| 79 20 69 6e 20 74 68 65 | 0a 63 75 72 72 65 6e 74 |y in the|.current|
|000007a0| 20 41 6d 69 67 61 20 6d | 6f 64 65 6c 73 2c 20 62 | Amiga m|odels, b|
|000007b0| 75 74 20 74 68 69 73 20 | 6d 61 79 20 63 68 61 6e |ut this |may chan|
|000007c0| 67 65 2e 29 20 20 54 6f | 20 74 68 65 20 36 38 30 |ge.) To| the 680|
|000007d0| 30 30 2c 20 69 74 20 61 | 70 70 65 61 72 73 20 61 |00, it a|ppears a|
|000007e0| 73 20 61 0a 73 65 74 20 | 6f 66 20 61 70 70 72 6f |s a.set |of appro|
|000007f0| 78 69 6d 61 74 65 6c 79 | 20 74 77 65 6e 74 79 20 |ximately| twenty |
|00000800| 73 69 78 74 65 65 6e 20 | 62 69 74 20 77 72 69 74 |sixteen |bit writ|
|00000810| 65 20 6f 6e 6c 79 20 72 | 65 67 69 73 74 65 72 73 |e only r|egisters|
|00000820| 2e 20 20 49 74 20 63 61 | 6e 0a 61 63 63 65 73 73 |. It ca|n.access|
|00000830| 20 6d 65 6d 6f 72 79 20 | 61 74 20 37 2e 32 20 6d | memory |at 7.2 m|
|00000840| 65 67 61 62 79 74 65 73 | 20 70 65 72 20 73 65 63 |egabytes| per sec|
|00000850| 6f 6e 64 2c 20 6f 72 20 | 74 77 69 63 65 20 74 68 |ond, or |twice th|
|00000860| 65 20 62 61 6e 64 77 69 | 64 74 68 20 6f 66 0a 74 |e bandwi|dth of.t|
|00000870| 68 65 20 36 38 30 30 30 | 20 28 61 6c 74 68 6f 75 |he 68000| (althou|
|00000880| 67 68 2c 20 61 73 20 77 | 65 20 73 68 61 6c 6c 20 |gh, as w|e shall |
|00000890| 73 65 65 2c 20 69 74 20 | 64 6f 65 73 6e 27 74 20 |see, it |doesn't |
|000008a0| 61 6c 77 61 79 73 20 72 | 75 6e 20 74 68 69 73 20 |always r|un this |
|000008b0| 66 61 73 74 2e 29 0a 41 | 6e 79 20 76 69 64 65 6f |fast.).A|ny video|
|000008c0| 20 6d 65 6d 6f 72 79 20 | 61 63 63 65 73 73 65 73 | memory |accesses|
|000008d0| 20 63 61 6e 20 73 6c 6f | 77 20 74 68 65 20 62 6c | can slo|w the bl|
|000008e0| 69 74 74 65 72 20 64 6f | 77 6e 2c 20 77 68 65 74 |itter do|wn, whet|
|000008f0| 68 65 72 20 66 6f 72 0a | 73 63 72 65 65 6e 20 72 |her for.|screen r|
|00000900| 65 66 72 65 73 68 20 6f | 72 20 66 6f 72 20 74 68 |efresh o|r for th|
|00000910| 65 20 36 38 30 30 30 2e | 20 20 46 6f 72 20 69 6e |e 68000.| For in|
|00000920| 73 74 61 6e 63 65 2c 20 | 74 68 65 20 73 74 61 6e |stance, |the stan|
|00000930| 64 61 72 64 20 74 77 6f | 20 62 69 74 0a 64 65 65 |dard two| bit.dee|
|00000940| 70 20 68 69 67 68 20 72 | 65 73 6f 6c 75 74 69 6f |p high r|esolutio|
|00000950| 6e 20 77 6f 72 6b 62 65 | 6e 63 68 20 73 63 72 65 |n workbe|nch scre|
|00000960| 65 6e 20 63 61 6e 20 73 | 6c 6f 77 20 74 68 65 20 |en can s|low the |
|00000970| 62 6c 69 74 74 65 72 20 | 64 6f 77 6e 20 62 79 0a |blitter |down by.|
|00000980| 61 70 70 72 6f 78 69 6d | 61 74 65 6c 79 20 33 30 |approxim|ately 30|
|00000990| 5c 25 2e 20 20 41 20 6c | 6f 77 20 72 65 73 6f 6c |\%. A l|ow resol|
|000009a0| 75 74 69 6f 6e 20 73 69 | 6e 67 6c 65 20 62 69 74 |ution si|ngle bit|
|000009b0| 20 70 6c 61 6e 65 20 73 | 63 72 65 65 6e 20 63 61 | plane s|creen ca|
|000009c0| 6e 20 73 6c 6f 77 20 69 | 74 0a 64 6f 77 6e 20 62 |n slow i|t.down b|
|000009d0| 79 20 61 62 6f 75 74 20 | 38 5c 25 2e 20 20 41 20 |y about |8\%. A |
|000009e0| 68 69 67 68 20 72 65 73 | 6f 6c 75 74 69 6f 6e 20 |high res|olution |
|000009f0| 66 6f 75 72 20 62 69 74 | 20 70 6c 61 6e 65 20 73 |four bit| plane s|
|00000a00| 63 72 65 65 6e 20 63 61 | 6e 20 73 6c 6f 77 20 64 |creen ca|n slow d|
|00000a10| 6f 77 6e 0a 74 68 65 20 | 62 6c 69 74 74 65 72 20 |own.the |blitter |
|00000a20| 62 79 20 61 62 6f 75 74 | 20 36 30 5c 25 2e 20 20 |by about| 60\%. |
|00000a30| 54 68 65 20 62 6c 69 74 | 74 65 72 20 69 73 20 73 |The blit|ter is s|
|00000a40| 6f 20 66 61 73 74 2c 20 | 68 6f 77 65 76 65 72 2c |o fast, |however,|
|00000a50| 20 74 68 61 74 20 65 76 | 65 6e 0a 77 69 74 68 20 | that ev|en.with |
|00000a60| 74 68 69 73 20 68 61 6e | 64 69 63 61 70 20 69 74 |this han|dicap it|
|00000a70| 20 70 65 72 66 6f 72 6d | 73 20 69 74 73 20 74 61 | perform|s its ta|
|00000a80| 73 6b 73 20 6d 61 6e 79 | 20 74 69 6d 65 73 20 66 |sks many| times f|
|00000a90| 61 73 74 65 72 20 74 68 | 61 6e 20 74 68 65 20 36 |aster th|an the 6|
|00000aa0| 38 30 30 30 2e 0a 0a 54 | 68 65 20 66 69 72 73 74 |8000...T|he first|
|00000ab0| 20 74 68 69 6e 67 20 61 | 20 70 72 6f 67 72 61 6d | thing a| program|
|00000ac0| 6d 65 72 20 6f 66 20 74 | 68 69 73 20 63 68 69 70 |mer of t|his chip|
|00000ad0| 20 6d 75 73 74 20 72 65 | 61 6c 69 7a 65 20 69 73 | must re|alize is|
|00000ae0| 20 74 68 61 74 0a 74 68 | 65 20 41 6d 69 67 61 20 | that.th|e Amiga |
|00000af0| 62 6c 69 74 74 65 72 20 | 69 73 20 6e 6f 74 20 61 |blitter |is not a|
|00000b00| 20 60 62 69 74 27 20 62 | 6c 69 74 74 65 72 3b 20 | `bit' b|litter; |
|00000b10| 72 61 74 68 65 72 2c 20 | 69 74 20 6f 70 65 72 61 |rather, |it opera|
|00000b20| 74 65 73 20 6f 6e 20 77 | 6f 72 64 73 2e 0a 54 68 |tes on w|ords..Th|
|00000b30| 69 73 20 66 61 63 74 20 | 6d 75 73 74 20 62 65 20 |is fact |must be |
|00000b40| 6b 65 70 74 20 69 6e 20 | 6d 69 6e 64 20 77 68 65 |kept in |mind whe|
|00000b50| 6e 20 70 72 6f 67 72 61 | 6d 6d 69 6e 67 20 74 68 |n progra|mming th|
|00000b60| 65 20 62 6c 69 74 74 65 | 72 2e 0a 57 69 74 68 20 |e blitte|r..With |
|00000b70| 74 68 65 20 61 70 70 72 | 6f 70 72 69 61 74 65 20 |the appr|opriate |
|00000b80| 70 72 6f 67 72 61 6d 6d | 69 6e 67 2c 20 69 74 20 |programm|ing, it |
|00000b90| 63 61 6e 20 6d 61 6e 69 | 70 75 6c 61 74 65 20 61 |can mani|pulate a|
|00000ba0| 72 62 69 74 72 61 72 79 | 20 72 65 63 74 61 6e 67 |rbitrary| rectang|
|00000bb0| 6c 65 73 0a 6f 66 20 62 | 69 74 73 2e 0a 0a 54 68 |les.of b|its...Th|
|00000bc0| 65 20 62 6c 69 74 74 65 | 72 20 75 73 65 73 20 66 |e blitte|r uses f|
|00000bd0| 6f 75 72 20 44 4d 41 20 | 63 68 61 6e 6e 65 6c 73 |our DMA |channels|
|00000be0| 20 74 6f 20 70 65 72 66 | 6f 72 6d 20 69 74 73 20 | to perf|orm its |
|00000bf0| 77 6f 72 6b 3b 20 74 68 | 65 73 65 20 61 72 65 20 |work; th|ese are |
|00000c00| 6c 61 62 65 6c 65 64 0a | 41 2c 20 42 2c 20 61 6e |labeled.|A, B, an|
|00000c10| 64 20 43 20 28 73 6f 75 | 72 63 65 73 29 20 61 6e |d C (sou|rces) an|
|00000c20| 64 20 44 20 28 64 65 73 | 74 69 6e 61 74 69 6f 6e |d D (des|tination|
|00000c30| 29 2e 20 20 41 6e 79 20 | 6f 72 20 61 6c 6c 20 6f |). Any |or all o|
|00000c40| 66 20 74 68 65 6d 20 6d | 61 79 20 62 65 0a 64 69 |f them m|ay be.di|
|00000c50| 73 61 62 6c 65 64 20 69 | 6e 64 65 70 65 6e 64 65 |sabled i|ndepende|
|00000c60| 6e 74 6c 79 2e 20 20 54 | 68 65 20 64 65 73 74 69 |ntly. T|he desti|
|00000c70| 6e 61 74 69 6f 6e 20 63 | 61 6e 20 62 65 20 63 61 |nation c|an be ca|
|00000c80| 6c 63 75 6c 61 74 65 64 | 20 66 72 6f 6d 20 61 6e |lculated| from an|
|00000c90| 79 20 6f 66 0a 32 35 36 | 20 70 6f 73 73 69 62 6c |y of.256| possibl|
|00000ca0| 65 20 6c 6f 67 69 63 61 | 6c 20 65 71 75 61 74 69 |e logica|l equati|
|00000cb0| 6f 6e 73 20 6f 6e 20 41 | 2c 20 42 2c 20 61 6e 64 |ons on A|, B, and|
|00000cc0| 20 43 2e 20 20 54 68 65 | 20 41 20 61 6e 64 20 42 | C. The| A and B|
|00000cd0| 20 73 6f 75 72 63 65 73 | 20 63 61 6e 0a 62 65 20 | sources| can.be |
|00000ce0| 73 68 69 66 74 65 64 20 | 75 70 20 74 6f 20 31 35 |shifted |up to 15|
|00000cf0| 20 62 69 74 73 20 74 6f | 20 74 68 65 20 72 69 67 | bits to| the rig|
|00000d00| 68 74 2c 20 61 6e 64 20 | 74 68 65 20 66 69 72 73 |ht, and |the firs|
|00000d10| 74 20 61 6e 64 20 6c 61 | 73 74 20 77 6f 72 64 20 |t and la|st word |
|00000d20| 69 6e 20 61 0a 6c 69 6e | 65 20 66 72 6f 6d 20 74 |in a.lin|e from t|
|00000d30| 68 65 20 41 20 73 6f 75 | 72 63 65 20 63 61 6e 20 |he A sou|rce can |
|00000d40| 62 65 20 6d 61 73 6b 65 | 64 20 62 79 20 61 20 63 |be maske|d by a c|
|00000d50| 6f 6e 73 74 61 6e 74 2e | 20 20 45 61 63 68 20 6f |onstant.| Each o|
|00000d60| 66 20 74 68 65 20 66 6f | 75 72 0a 63 68 61 6e 6e |f the fo|ur.chann|
|00000d70| 65 6c 73 20 68 61 73 20 | 69 74 73 20 6f 77 6e 20 |els has |its own |
|00000d80| 6d 6f 64 75 6c 6f 2e 20 | 20 54 68 65 20 62 6c 69 |modulo. | The bli|
|00000d90| 74 74 65 72 20 61 6c 73 | 6f 20 68 61 73 20 61 6e |tter als|o has an|
|00000da0| 20 61 72 65 61 20 66 69 | 6c 6c 20 61 6e 64 20 61 | area fi|ll and a|
|00000db0| 0a 6c 69 6e 65 20 64 72 | 61 77 20 6d 6f 64 65 2e |.line dr|aw mode.|
|00000dc0| 0a 0a 5c 73 65 63 74 69 | 6f 6e 20 47 65 74 74 69 |..\secti|on Getti|
|00000dd0| 6e 67 20 41 63 63 65 73 | 73 5c 5c 0a 0a 54 68 65 |ng Acces|s\\..The|
|00000de0| 72 65 20 61 72 65 20 63 | 75 72 72 65 6e 74 6c 79 |re are c|urrently|
|00000df0| 20 66 6f 75 72 20 77 61 | 79 73 20 79 6f 75 20 63 | four wa|ys you c|
|00000e00| 61 6e 20 75 73 65 20 74 | 68 65 20 62 6c 69 74 74 |an use t|he blitt|
|00000e10| 65 72 2e 20 20 53 6f 6d | 65 20 77 6f 72 6b 20 62 |er. Som|e work b|
|00000e20| 65 74 74 65 72 0a 74 68 | 61 6e 20 6f 74 68 65 72 |etter.th|an other|
|00000e30| 73 2e 20 20 54 68 65 20 | 66 69 72 73 74 20 77 61 |s. The |first wa|
|00000e40| 79 20 69 73 20 74 6f 20 | 75 73 65 20 74 68 65 20 |y is to |use the |
|00000e50| 73 74 61 6e 64 61 72 64 | 20 52 4f 4d 20 4b 65 72 |standard| ROM Ker|
|00000e60| 6e 65 6c 20 72 6f 75 74 | 69 6e 65 73 0a 66 6f 72 |nel rout|ines.for|
|00000e70| 20 67 72 61 70 68 69 63 | 73 2e 20 20 54 68 69 73 | graphic|s. This|
|00000e80| 20 69 73 20 74 68 65 20 | 73 69 6d 70 6c 65 73 74 | is the |simplest|
|00000e90| 20 61 6e 64 20 6d 6f 73 | 74 20 72 65 6c 69 61 62 | and mos|t reliab|
|00000ea0| 6c 65 20 6d 65 74 68 6f | 64 3b 20 66 75 74 75 72 |le metho|d; futur|
|00000eb0| 65 0a 62 6c 69 74 74 65 | 72 73 20 61 6e 64 20 6f |e.blitte|rs and o|
|00000ec0| 70 65 72 61 74 69 6e 67 | 20 73 79 73 74 65 6d 73 |perating| systems|
|00000ed0| 20 77 69 6c 6c 20 6e 6f | 74 20 64 69 73 72 75 70 | will no|t disrup|
|00000ee0| 74 20 79 6f 75 72 20 63 | 6f 64 65 2e 20 20 49 20 |t your c|ode. I |
|00000ef0| 61 6d 20 6e 6f 74 0a 67 | 6f 69 6e 67 20 74 6f 20 |am not.g|oing to |
|00000f00| 64 69 73 63 75 73 73 20 | 74 68 69 73 20 61 70 70 |discuss |this app|
|00000f10| 72 6f 61 63 68 20 68 65 | 72 65 2c 20 62 65 63 61 |roach he|re, beca|
|00000f20| 75 73 65 20 49 20 64 6f | 6e 27 74 20 77 61 6e 74 |use I do|n't want|
|00000f30| 20 74 6f 2c 20 61 6e 64 | 20 61 6c 6c 20 6f 66 0a | to, and| all of.|
|00000f40| 74 68 61 74 20 69 6e 66 | 6f 72 6d 61 74 69 6f 6e |that inf|ormation|
|00000f50| 20 69 73 20 69 6e 20 74 | 68 65 20 52 4f 4d 20 4b | is in t|he ROM K|
|00000f60| 65 72 6e 65 6c 20 4d 61 | 6e 75 61 6c 73 2e 20 20 |ernel Ma|nuals. |
|00000f70| 54 68 65 20 73 65 63 6f | 6e 64 20 6d 65 74 68 6f |The seco|nd metho|
|00000f80| 64 20 69 73 0a 74 6f 20 | 61 72 62 69 74 72 61 72 |d is.to |arbitrar|
|00000f90| 69 6c 79 20 77 72 69 74 | 65 20 74 6f 20 74 68 65 |ily writ|e to the|
|00000fa0| 20 62 6c 69 74 74 65 72 | 20 72 65 67 69 73 74 65 | blitter| registe|
|00000fb0| 72 73 2c 20 69 67 6e 6f | 72 69 6e 67 20 49 6e 74 |rs, igno|ring Int|
|00000fc0| 75 69 74 69 6f 6e 0a 61 | 6e 64 20 66 72 69 65 6e |uition.a|nd frien|
|00000fd0| 64 73 2e 20 20 54 68 69 | 73 20 69 73 20 61 20 67 |ds. Thi|s is a g|
|00000fe0| 6f 6f 64 20 77 61 79 20 | 74 6f 20 6d 61 6b 65 20 |ood way |to make |
|00000ff0| 65 6e 65 6d 69 65 73 3b | 20 79 6f 75 20 63 61 6e |enemies;| you can|
|00001000| 20 74 72 61 73 68 20 64 | 69 73 6b 73 0a 61 73 20 | trash d|isks.as |
|00001010| 77 65 6c 6c 20 61 73 20 | 73 79 73 74 65 6d 20 6d |well as |system m|
|00001020| 65 6d 6f 72 79 2c 20 62 | 75 74 20 69 74 20 6d 61 |emory, b|ut it ma|
|00001030| 6b 65 73 20 66 6f 72 20 | 67 6f 6f 64 20 6c 61 75 |kes for |good lau|
|00001040| 67 68 73 20 6f 6e 20 74 | 68 6f 73 65 20 73 6c 6f |ghs on t|hose slo|
|00001050| 77 0a 77 69 6e 74 65 72 | 20 6e 69 67 68 74 73 2e |w.winter| nights.|
|00001060| 20 20 4a 75 73 74 20 70 | 6f 70 20 73 6f 6d 65 20 | Just p|op some |
|00001070| 72 61 6e 64 6f 6d 20 76 | 61 6c 75 65 73 20 69 6e |random v|alues in|
|00001080| 74 6f 20 74 68 6f 73 65 | 20 62 6c 69 74 74 65 72 |to those| blitter|
|00001090| 20 72 65 67 69 73 74 65 | 72 73 2c 0a 61 6e 64 20 | registe|rs,.and |
|000010a0| 77 61 74 63 68 20 74 68 | 65 20 70 79 72 6f 74 65 |watch th|e pyrote|
|000010b0| 63 68 6e 69 63 73 20 66 | 6c 79 21 0a 0a 54 68 65 |chnics f|ly!..The|
|000010c0| 20 74 68 69 72 64 20 6d | 65 74 68 6f 64 20 69 73 | third m|ethod is|
|000010d0| 20 61 20 76 61 72 69 61 | 74 69 6f 6e 20 6f 66 20 | a varia|tion of |
|000010e0| 74 68 65 20 73 65 63 6f | 6e 64 2c 20 62 75 74 20 |the seco|nd, but |
|000010f0| 79 6f 75 20 70 6f 6c 69 | 74 65 6c 79 20 72 65 71 |you poli|tely req|
|00001100| 75 65 73 74 0a 70 65 72 | 6d 69 73 73 69 6f 6e 20 |uest.per|mission |
|00001110| 66 72 6f 6d 20 74 68 65 | 20 73 79 73 74 65 6d 20 |from the| system |
|00001120| 66 69 72 73 74 2c 20 62 | 79 20 63 61 6c 6c 69 6e |first, b|y callin|
|00001130| 67 20 5c 62 20 4f 77 6e | 42 6c 69 74 74 65 72 28 |g \b Own|Blitter(|
|00001140| 29 2e 20 20 54 68 69 73 | 20 72 6f 75 74 69 6e 65 |). This| routine|
|00001150| 0a 6e 6f 74 69 66 69 65 | 73 20 74 68 65 20 41 6d |.notifie|s the Am|
|00001160| 69 67 61 20 74 68 61 74 | 20 79 6f 75 20 77 61 6e |iga that| you wan|
|00001170| 74 20 65 78 63 6c 75 73 | 69 76 65 20 61 63 63 65 |t exclus|ive acce|
|00001180| 73 73 20 74 6f 20 74 68 | 65 20 62 6c 69 74 74 65 |ss to th|e blitte|
|00001190| 72 2c 20 61 6e 64 20 79 | 6f 75 0a 64 6f 6e 27 74 |r, and y|ou.don't|
|000011a0| 20 77 61 6e 74 20 61 6e | 79 6f 6e 65 20 65 6c 73 | want an|yone els|
|000011b0| 65 20 70 6c 61 79 69 6e | 67 20 77 69 74 68 20 69 |e playin|g with i|
|000011c0| 74 2e 20 20 41 66 74 65 | 72 20 74 68 69 73 0a 63 |t. Afte|r this.c|
|000011d0| 61 6c 6c 20 72 65 74 75 | 72 6e 73 2c 20 79 6f 75 |all retu|rns, you|
|000011e0| 20 63 61 6e 20 61 6c 6d | 6f 73 74 20 75 73 65 20 | can alm|ost use |
|000011f0| 74 68 65 20 62 6c 69 74 | 74 65 72 2e 20 20 55 6e |the blit|ter. Un|
|00001200| 66 6f 72 74 75 6e 61 74 | 65 6c 79 2c 20 73 6f 6d |fortunat|ely, som|
|00001210| 65 6f 6e 65 0a 65 6c 73 | 65 20 6d 61 79 20 68 61 |eone.els|e may ha|
|00001220| 76 65 20 61 6c 72 65 61 | 64 79 20 67 69 76 65 6e |ve alrea|dy given|
|00001230| 20 74 68 65 20 62 6c 69 | 74 74 65 72 20 73 6f 6d | the bli|tter som|
|00001240| 65 74 68 69 6e 67 20 74 | 6f 20 64 6f 20 74 68 61 |ething t|o do tha|
|00001250| 74 20 68 61 73 6e 27 74 | 20 63 6f 6d 70 6c 65 74 |t hasn't| complet|
|00001260| 65 64 3b 0a 74 68 65 72 | 65 66 6f 72 65 2c 20 79 |ed;.ther|efore, y|
|00001270| 6f 75 20 73 68 6f 75 6c | 64 20 63 61 6c 6c 20 5c |ou shoul|d call \|
|00001280| 62 20 57 61 69 74 42 6c | 69 74 28 29 20 62 65 66 |b WaitBl|it() bef|
|00001290| 6f 72 65 20 61 63 74 75 | 61 6c 6c 79 20 6d 75 63 |ore actu|ally muc|
|000012a0| 6b 69 6e 67 20 77 69 74 | 68 0a 74 68 65 20 72 65 |king wit|h.the re|
|000012b0| 67 69 73 74 65 72 73 2e | 20 20 54 68 69 73 20 73 |gisters.| This s|
|000012c0| 65 63 6f 6e 64 20 72 6f | 75 74 69 6e 65 20 62 6c |econd ro|utine bl|
|000012d0| 6f 63 6b 73 20 75 6e 74 | 69 6c 20 74 68 65 20 62 |ocks unt|il the b|
|000012e0| 6c 69 74 74 65 72 20 69 | 73 20 61 63 74 75 61 6c |litter i|s actual|
|000012f0| 6c 79 0a 66 69 6e 69 73 | 68 65 64 20 77 69 74 68 |ly.finis|hed with|
|00001300| 20 69 74 73 20 77 6f 72 | 6b 2e 20 20 4f 6e 63 65 | its wor|k. Once|
|00001310| 20 5c 62 20 57 61 69 74 | 42 6c 69 74 28 29 20 72 | \b Wait|Blit() r|
|00001320| 65 74 75 72 6e 73 2c 20 | 79 6f 75 20 61 72 65 20 |eturns, |you are |
|00001330| 66 72 65 65 20 74 6f 20 | 64 6f 0a 77 68 61 74 20 |free to |do.what |
|00001340| 79 6f 75 20 6c 69 6b 65 | 20 77 69 74 68 20 74 68 |you like| with th|
|00001350| 65 20 62 6c 69 74 74 65 | 72 2e 0a 0a 57 68 69 6c |e blitte|r...Whil|
|00001360| 65 20 79 6f 75 20 68 61 | 76 65 20 74 68 65 20 62 |e you ha|ve the b|
|00001370| 6c 69 74 74 65 72 2c 20 | 79 6f 75 20 6d 75 73 74 |litter, |you must|
|00001380| 20 72 65 6d 65 6d 62 65 | 72 20 74 68 61 74 20 74 | remembe|r that t|
|00001390| 68 65 20 72 65 73 74 20 | 6f 66 20 74 68 65 20 73 |he rest |of the s|
|000013a0| 79 73 74 65 6d 0a 63 61 | 6e 6e 6f 74 20 75 73 65 |ystem.ca|nnot use|
|000013b0| 20 69 74 2e 20 20 54 68 | 65 72 65 66 6f 72 65 2c | it. Th|erefore,|
|000013c0| 20 5c 62 20 54 65 78 74 | 28 29 20 63 61 6c 6c 73 | \b Text|() calls|
|000013d0| 20 77 69 6c 6c 20 6e 6f | 74 20 77 6f 72 6b 2c 20 | will no|t work, |
|000013e0| 61 6e 64 20 79 6f 75 72 | 20 64 65 62 75 67 0a 70 |and your| debug.p|
|000013f0| 72 69 6e 74 66 27 73 20 | 77 69 6c 6c 20 62 6c 6f |rintf's |will blo|
|00001400| 63 6b 20 69 66 20 74 68 | 65 79 20 61 72 65 20 77 |ck if th|ey are w|
|00001410| 72 69 74 74 65 6e 20 74 | 6f 20 74 68 65 20 73 63 |ritten t|o the sc|
|00001420| 72 65 65 6e 2e 0a 54 68 | 65 20 62 6c 69 74 74 65 |reen..Th|e blitte|
|00001430| 72 20 69 73 20 75 73 65 | 64 20 66 6f 72 20 64 69 |r is use|d for di|
|00001440| 73 6b 20 49 2f 4f 20 61 | 6e 64 20 6d 6f 73 74 20 |sk I/O a|nd most |
|00001450| 75 73 65 72 20 69 6e 74 | 65 72 61 63 74 69 6f 6e |user int|eraction|
|00001460| 20 6c 69 6b 65 20 67 61 | 64 67 65 74 73 2c 0a 73 | like ga|dgets,.s|
|00001470| 6f 20 74 79 69 6e 67 0a | 75 70 20 74 68 65 20 62 |o tying.|up the b|
|00001480| 6c 69 74 74 65 72 20 66 | 6f 72 20 6c 6f 6e 67 20 |litter f|or long |
|00001490| 70 65 72 69 6f 64 73 20 | 6f 66 20 74 69 6d 65 20 |periods |of time |
|000014a0| 28 6c 6f 6e 67 65 72 20 | 74 68 61 6e 2c 20 73 61 |(longer |than, sa|
|000014b0| 79 2c 20 61 20 66 65 77 | 0a 6d 69 6c 6c 69 73 65 |y, a few|.millise|
|000014c0| 63 6f 6e 64 73 29 20 69 | 73 20 63 6f 6e 73 69 64 |conds) i|s consid|
|000014d0| 65 72 65 64 20 68 69 67 | 68 6c 79 20 75 6e 66 72 |ered hig|hly unfr|
|000014e0| 69 65 6e 64 6c 79 2e 20 | 20 54 79 69 6e 67 20 75 |iendly. | Tying u|
|000014f0| 70 20 74 68 65 20 62 6c | 69 74 74 65 72 0a 66 6f |p the bl|itter.fo|
|00001500| 72 20 61 20 73 65 63 6f | 6e 64 20 6f 72 20 6d 6f |r a seco|nd or mo|
|00001510| 72 65 20 69 73 20 67 72 | 6f 75 6e 64 73 20 66 6f |re is gr|ounds fo|
|00001520| 72 20 6c 79 6e 63 68 69 | 6e 67 2e 0a 0a 57 68 65 |r lynchi|ng...Whe|
|00001530| 6e 20 79 6f 75 20 61 72 | 65 20 66 69 6e 69 73 68 |n you ar|e finish|
|00001540| 65 64 20 77 69 74 68 20 | 74 68 65 20 62 6c 69 74 |ed with |the blit|
|00001550| 74 65 72 2c 20 79 6f 75 | 20 73 68 6f 75 6c 64 20 |ter, you| should |
|00001560| 63 61 6c 6c 20 5c 62 20 | 44 69 73 6f 77 6e 42 6c |call \b |DisownBl|
|00001570| 69 74 74 65 72 28 29 0a | 74 6f 20 61 6c 6c 6f 77 |itter().|to allow|
|00001580| 20 65 76 65 72 79 6f 6e | 65 20 65 6c 73 65 20 74 | everyon|e else t|
|00001590| 6f 20 64 6f 20 77 68 61 | 74 20 74 68 65 79 20 6c |o do wha|t they l|
|000015a0| 69 6b 65 2e 20 20 52 65 | 6d 65 6d 62 65 72 2c 20 |ike. Re|member, |
|000015b0| 68 6f 77 65 76 65 72 2c | 20 74 68 61 74 0a 5c 62 |however,| that.\b|
|000015c0| 20 44 69 73 6f 77 6e 42 | 6c 69 74 74 65 72 28 29 | DisownB|litter()|
|000015d0| 20 6d 69 67 68 74 20 72 | 65 74 75 72 6e 20 62 65 | might r|eturn be|
|000015e0| 66 6f 72 65 20 74 68 65 | 20 62 6c 69 74 74 65 72 |fore the| blitter|
|000015f0| 20 69 73 20 66 69 6e 69 | 73 68 65 64 20 77 69 74 | is fini|shed wit|
|00001600| 68 20 79 6f 75 72 0a 6c | 61 73 74 20 6f 70 65 72 |h your.l|ast oper|
|00001610| 61 74 69 6f 6e 2c 20 73 | 6f 20 62 65 66 6f 72 65 |ation, s|o before|
|00001620| 20 79 6f 75 20 75 73 65 | 20 61 6e 79 20 64 61 74 | you use| any dat|
|00001630| 61 20 63 72 65 61 74 65 | 64 20 62 79 20 74 68 65 |a create|d by the|
|00001640| 20 62 6c 69 74 74 65 72 | 2c 0a 63 61 6c 6c 20 5c | blitter|,.call \|
|00001650| 62 20 57 61 69 74 42 6c | 69 74 28 29 20 74 6f 20 |b WaitBl|it() to |
|00001660| 61 6c 6c 6f 77 20 74 68 | 65 20 62 6c 69 74 74 65 |allow th|e blitte|
|00001670| 72 20 74 6f 20 66 69 6e | 69 73 68 2e 0a 54 68 69 |r to fin|ish..Thi|
|00001680| 73 20 6c 61 73 74 20 70 | 6f 69 6e 74 20 69 73 20 |s last p|oint is |
|00001690| 77 6f 72 74 68 20 72 65 | 72 65 61 64 69 6e 67 2c |worth re|reading,|
|000016a0| 20 61 73 20 69 74 20 69 | 73 20 6f 66 74 65 6e 0a | as it i|s often.|
|000016b0| 74 68 65 20 73 6f 75 72 | 63 65 20 6f 66 20 73 6f |the sour|ce of so|
|000016c0| 6d 65 20 73 75 62 74 6c | 65 20 62 75 67 73 2e 0a |me subtl|e bugs..|
|000016d0| 0a 54 68 75 73 2c 20 79 | 6f 75 72 20 63 6f 64 65 |.Thus, y|our code|
|000016e0| 20 6d 69 67 68 74 20 6c | 6f 6f 6b 20 6c 69 6b 65 | might l|ook like|
|000016f0| 20 74 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 3a 0a | the fol|lowing:.|
|00001700| 0a 5c 62 76 0a 4f 77 6e | 42 6c 69 74 28 29 20 3b |.\bv.Own|Blit() ;|
|00001710| 0a 57 61 69 74 42 6c 69 | 74 28 29 20 3b 0a 2f 2a |.WaitBli|t() ;./*|
|00001720| 0a 20 2a 20 20 20 68 65 | 72 65 20 79 6f 75 20 63 |. * he|re you c|
|00001730| 61 6e 20 6d 75 63 6b 20 | 77 69 74 68 20 74 68 65 |an muck |with the|
|00001740| 20 62 6c 69 74 74 65 72 | 0a 20 2a 20 20 20 75 6e | blitter|. * un|
|00001750| 74 69 6c 20 69 74 20 66 | 61 6c 6c 73 20 6f 66 66 |til it f|alls off|
|00001760| 20 2e 20 2e 20 2e 0a 20 | 2a 2f 0a 64 72 61 77 5f | . . .. |*/.draw_|
|00001770| 6d 79 5f 70 6f 6c 79 67 | 6f 6e 73 28 29 20 3b 20 |my_polyg|ons() ; |
|00001780| 2f 2a 20 66 6f 72 20 65 | 78 61 6d 70 6c 65 20 2a |/* for e|xample *|
|00001790| 2f 0a 44 69 73 6f 77 6e | 42 6c 69 74 74 65 72 28 |/.Disown|Blitter(|
|000017a0| 29 20 3b 0a 2f 2a 0a 20 | 2a 20 20 20 4e 6f 77 20 |) ;./*. |* Now |
|000017b0| 77 65 20 77 61 6e 74 20 | 74 6f 20 65 78 61 6d 69 |we want |to exami|
|000017c0| 6e 65 20 74 68 65 20 6d | 65 6d 6f 72 79 20 72 65 |ne the m|emory re|
|000017d0| 67 69 6f 6e 0a 20 2a 20 | 20 20 74 68 65 20 62 6c |gion. * | the bl|
|000017e0| 69 74 74 65 72 20 70 6c | 61 79 65 64 20 77 69 74 |itter pl|ayed wit|
|000017f0| 68 2e 20 20 57 65 20 77 | 61 69 74 20 66 6f 72 0a |h. We w|ait for.|
|00001800| 20 2a 20 20 20 74 68 65 | 20 62 6c 69 74 20 74 6f | * the| blit to|
|00001810| 20 63 6f 6d 70 6c 65 74 | 65 2e 0a 20 2a 2f 0a 57 | complet|e.. */.W|
|00001820| 61 69 74 42 6c 69 74 28 | 29 20 3b 0a 63 6f 70 79 |aitBlit(|) ;.copy|
|00001830| 5f 74 6f 5f 64 69 73 6b | 28 29 20 3b 20 20 20 20 |_to_disk|() ; |
|00001840| 2f 2a 20 66 6f 72 20 65 | 78 61 6d 70 6c 65 20 2a |/* for e|xample *|
|00001850| 2f 0a 24 65 6e 64 76 65 | 72 62 0a 0a 54 68 65 72 |/.$endve|rb..Ther|
|00001860| 65 20 69 73 20 61 6e 6f | 74 68 65 72 20 77 61 79 |e is ano|ther way|
|00001870| 20 74 6f 20 67 61 69 6e | 20 61 63 63 65 73 73 20 | to gain| access |
|00001880| 74 6f 20 74 68 65 20 62 | 6c 69 74 74 65 72 3b 20 |to the b|litter; |
|00001890| 79 6f 75 20 63 61 6e 20 | 75 73 65 20 74 68 65 0a |you can |use the.|
|000018a0| 73 75 70 70 6c 69 65 64 | 20 71 75 65 75 65 20 62 |supplied| queue b|
|000018b0| 6c 69 74 74 65 72 20 72 | 6f 75 74 69 6e 65 73 2e |litter r|outines.|
|000018c0| 20 20 54 68 69 73 20 69 | 73 20 64 65 73 63 72 69 | This i|s descri|
|000018d0| 62 65 64 0a 69 6e 20 74 | 68 65 20 52 4f 4d 20 4b |bed.in t|he ROM K|
|000018e0| 65 72 6e 65 6c 20 4d 61 | 6e 75 61 6c 2c 20 56 6f |ernel Ma|nual, Vo|
|000018f0| 6c 75 6d 65 20 31 2c 20 | 70 61 67 65 73 20 32 2d |lume 1, |pages 2-|
|00001900| 36 32 20 74 68 72 6f 75 | 67 68 20 32 2d 36 35 2e |62 throu|gh 2-65.|
|00001910| 20 20 41 73 20 6f 66 20 | 79 65 74 2c 0a 49 20 68 | As of |yet,.I h|
|00001920| 61 76 65 6e 27 74 20 68 | 61 64 20 72 65 61 73 6f |aven't h|ad reaso|
|00001930| 6e 20 74 6f 20 75 73 65 | 20 74 68 65 73 65 20 72 |n to use| these r|
|00001940| 6f 75 74 69 6e 65 73 3b | 20 70 65 72 68 61 70 73 |outines;| perhaps|
|00001950| 20 61 20 6c 61 74 65 72 | 20 65 64 69 74 69 6f 6e | a later| edition|
|00001960| 20 6f 66 0a 74 68 69 73 | 20 6d 61 6e 75 73 63 72 | of.this| manuscr|
|00001970| 69 70 74 20 77 69 6c 6c | 20 68 61 76 65 20 69 6e |ipt will| have in|
|00001980| 66 6f 72 6d 61 74 69 6f | 6e 20 6f 6e 20 74 68 65 |formatio|n on the|
|00001990| 6d 2e 0a 0a 5c 73 65 63 | 74 69 6f 6e 20 42 6c 69 |m...\sec|tion Bli|
|000019a0| 74 4c 61 62 5c 5c 0a 0a | 54 6f 20 61 6c 6c 6f 77 |tLab\\..|To allow|
|000019b0| 20 65 61 73 79 20 65 78 | 70 65 72 69 6d 65 6e 74 | easy ex|periment|
|000019c0| 61 74 69 6f 6e 20 77 69 | 74 68 20 74 68 65 20 62 |ation wi|th the b|
|000019d0| 6c 69 74 74 65 72 2c 20 | 49 20 68 61 76 65 20 77 |litter, |I have w|
|000019e0| 72 69 74 74 65 6e 20 61 | 20 70 72 6f 67 72 61 6d |ritten a| program|
|000019f0| 0a 63 61 6c 6c 65 64 20 | 42 6c 69 74 4c 61 62 2e |.called |BlitLab.|
|00001a00| 20 20 54 68 69 73 20 70 | 72 6f 67 72 61 6d 20 70 | This p|rogram p|
|00001a10| 72 6f 76 69 64 65 73 20 | 61 20 6c 61 62 6f 72 61 |rovides |a labora|
|00001a20| 74 6f 72 79 20 69 6e 20 | 77 68 69 63 68 20 79 6f |tory in |which yo|
|00001a30| 75 20 63 61 6e 0a 70 6c | 61 79 20 77 69 74 68 20 |u can.pl|ay with |
|00001a40| 74 68 65 20 62 6c 69 74 | 74 65 72 20 72 65 67 69 |the blit|ter regi|
|00001a50| 73 74 65 72 73 20 69 6e | 20 61 20 73 6f 6d 65 77 |sters in| a somew|
|00001a60| 68 61 74 20 73 61 66 65 | 20 6d 61 6e 6e 65 72 2e |hat safe| manner.|
|00001a70| 0a 0a 54 68 65 20 62 6c | 69 74 74 65 72 20 68 61 |..The bl|itter ha|
|00001a80| 73 20 61 20 6d 75 63 68 | 20 67 72 65 61 74 65 72 |s a much| greater|
|00001a90| 20 70 6f 74 65 6e 74 69 | 61 6c 20 66 6f 72 20 64 | potenti|al for d|
|00001aa0| 61 6d 61 67 65 20 74 6f | 20 73 79 73 74 65 6d 20 |amage to| system |
|00001ab0| 6d 65 6d 6f 72 79 0a 74 | 68 61 6e 20 74 68 65 20 |memory.t|han the |
|00001ac0| 36 38 30 30 30 20 64 6f | 65 73 2c 20 73 69 6e 63 |68000 do|es, sinc|
|00001ad0| 65 20 6f 6e 63 65 20 73 | 74 61 72 74 65 64 20 69 |e once s|tarted i|
|00001ae0| 74 20 70 65 72 66 6f 72 | 6d 73 20 6f 70 65 72 61 |t perfor|ms opera|
|00001af0| 74 69 6f 6e 73 20 6f 6e | 20 6c 61 72 67 65 0a 61 |tions on| large.a|
|00001b00| 72 65 61 73 20 6f 66 20 | 6d 65 6d 6f 72 79 20 77 |reas of |memory w|
|00001b10| 69 74 68 6f 75 74 20 69 | 6e 74 65 72 72 75 70 74 |ithout i|nterrupt|
|00001b20| 69 6f 6e 20 6f 72 20 69 | 6e 73 74 72 75 63 74 69 |ion or i|nstructi|
|00001b30| 6f 6e 20 63 68 65 63 6b | 69 6e 67 2e 20 20 49 66 |on check|ing. If|
|00001b40| 20 74 68 65 0a 36 38 30 | 30 30 20 73 74 61 72 74 | the.680|00 start|
|00001b50| 73 20 65 78 65 63 75 74 | 69 6e 67 20 72 61 6e 64 |s execut|ing rand|
|00001b60| 6f 6d 20 64 61 74 61 20 | 61 73 20 69 6e 73 74 72 |om data |as instr|
|00001b70| 75 63 74 69 6f 6e 73 2c | 20 69 74 20 75 73 75 61 |uctions,| it usua|
|00001b80| 6c 6c 79 20 76 65 72 79 | 0a 71 75 69 63 6b 6c 79 |lly very|.quickly|
|00001b90| 20 65 78 65 63 75 74 65 | 73 20 61 6e 20 6f 64 64 | execute|s an odd|
|00001ba0| 2d 61 64 64 72 65 73 73 | 20 6f 72 20 69 6c 6c 65 |-address| or ille|
|00001bb0| 67 61 6c 20 6f 70 2d 63 | 6f 64 65 20 74 72 61 70 |gal op-c|ode trap|
|00001bc0| 2e 20 20 54 68 65 20 62 | 6c 69 74 74 65 72 2c 0a |. The b|litter,.|
|00001bd0| 6f 6e 20 74 68 65 20 6f | 74 68 65 72 20 68 61 6e |on the o|ther han|
|00001be0| 64 2c 20 63 6f 75 6c 64 | 20 65 61 73 69 6c 79 20 |d, could| easily |
|00001bf0| 77 69 70 65 20 6f 75 74 | 20 6b 69 6c 6f 62 79 74 |wipe out| kilobyt|
|00001c00| 65 73 20 6f 66 20 64 61 | 74 61 20 62 65 66 6f 72 |es of da|ta befor|
|00001c10| 65 20 74 68 65 0a 73 79 | 73 74 65 6d 20 6e 6f 74 |e the.sy|stem not|
|00001c20| 69 63 65 64 20 61 6e 79 | 74 68 69 6e 67 20 77 61 |iced any|thing wa|
|00001c30| 73 20 61 6d 6f 6b 2e 20 | 20 42 6c 69 74 4c 61 62 |s amok. | BlitLab|
|00001c40| 20 74 68 65 72 65 66 6f | 72 65 20 63 61 72 65 66 | therefo|re caref|
|00001c50| 75 6c 6c 79 20 63 68 65 | 63 6b 73 0a 74 68 65 20 |ully che|cks.the |
|00001c60| 76 61 6c 75 65 73 20 79 | 6f 75 20 68 61 76 65 20 |values y|ou have |
|00001c70| 65 6e 74 65 72 65 64 20 | 74 6f 20 62 65 20 73 75 |entered |to be su|
|00001c80| 72 65 20 74 68 61 74 20 | 73 79 73 74 65 6d 20 6d |re that |system m|
|00001c90| 65 6d 6f 72 79 20 77 69 | 6c 6c 20 6e 6f 74 20 62 |emory wi|ll not b|
|00001ca0| 65 0a 6f 76 65 72 77 72 | 69 74 74 65 6e 2e 20 20 |e.overwr|itten. |
|00001cb0| 4f 6e 6c 79 20 69 66 20 | 69 74 20 77 69 6c 6c 20 |Only if |it will |
|00001cc0| 6e 6f 74 20 62 65 20 61 | 72 65 20 79 6f 75 20 61 |not be a|re you a|
|00001cd0| 6c 6c 6f 77 65 64 20 74 | 6f 20 64 6f 20 74 68 65 |llowed t|o do the|
|00001ce0| 20 62 6c 69 74 2e 0a 54 | 68 61 74 20 69 73 2c 20 | blit..T|hat is, |
|00001cf0| 65 78 63 65 70 74 20 66 | 6f 72 20 6c 69 6e 65 20 |except f|or line |
|00001d00| 6d 6f 64 65 3b 20 69 74 | 20 69 73 20 73 6f 20 63 |mode; it| is so c|
|00001d10| 6f 6d 70 6c 69 63 61 74 | 65 64 20 74 6f 20 63 68 |omplicat|ed to ch|
|00001d20| 65 63 6b 20 66 6f 72 20 | 6c 69 6e 65 0a 6d 6f 64 |eck for |line.mod|
|00001d30| 65 20 76 61 6c 69 64 69 | 74 79 2c 20 74 68 61 74 |e validi|ty, that|
|00001d40| 20 49 20 6c 65 74 20 79 | 6f 75 20 74 72 61 73 68 | I let y|ou trash|
|00001d50| 20 6d 65 6d 6f 72 79 20 | 77 69 74 68 20 69 74 2e | memory |with it.|
|00001d60| 20 20 42 75 74 20 6d 6f | 72 65 20 6f 6e 20 74 68 | But mo|re on th|
|00001d70| 61 74 0a 6c 61 74 65 72 | 2e 0a 0a 57 69 74 68 20 |at.later|...With |
|00001d80| 42 6c 69 74 4c 61 62 2c | 20 79 6f 75 20 63 61 6e |BlitLab,| you can|
|00001d90| 20 65 69 74 68 65 72 20 | 75 73 65 20 74 68 65 20 | either |use the |
|00001da0| 61 63 74 75 61 6c 20 62 | 6c 69 74 74 65 72 20 74 |actual b|litter t|
|00001db0| 6f 20 70 65 72 66 6f 72 | 6d 20 74 68 65 0a 65 78 |o perfor|m the.ex|
|00001dc0| 70 65 72 69 6d 65 6e 74 | 2c 20 6f 72 20 75 73 65 |periment|, or use|
|00001dd0| 20 61 20 62 6c 69 74 74 | 65 72 20 73 69 6d 75 6c | a blitt|er simul|
|00001de0| 61 74 6f 72 20 69 6e 63 | 6c 75 64 65 64 20 69 6e |ator inc|luded in|
|00001df0| 20 74 68 65 20 70 72 6f | 67 72 61 6d 2e 20 20 54 | the pro|gram. T|
|00001e00| 6f 0a 73 77 69 74 63 68 | 20 62 65 74 77 65 65 6e |o.switch| between|
|00001e10| 20 74 68 65 20 74 77 6f | 2c 20 68 69 74 20 74 68 | the two|, hit th|
|00001e20| 65 20 67 61 64 67 65 74 | 20 6d 61 72 6b 65 64 20 |e gadget| marked |
|00001e30| 60 52 65 61 6c 27 20 28 | 6f 72 0a 60 53 69 6d 75 |`Real' (|or.`Simu|
|00001e40| 6c 27 29 2e 20 20 57 68 | 65 6e 20 72 75 6e 6e 69 |l'). Wh|en runni|
|00001e50| 6e 67 20 77 69 74 68 20 | 61 20 73 69 6d 75 6c 61 |ng with |a simula|
|00001e60| 74 65 64 20 62 6c 69 74 | 74 65 72 2c 20 79 6f 75 |ted blit|ter, you|
|00001e70| 20 63 61 6e 20 77 72 69 | 74 65 20 61 20 6c 6f 67 | can wri|te a log|
|00001e80| 0a 66 69 6c 65 20 63 6f | 6e 74 61 69 6e 69 6e 67 |.file co|ntaining|
|00001e90| 20 74 68 65 20 61 63 74 | 69 6f 6e 73 20 6f 66 20 | the act|ions of |
|00001ea0| 74 68 65 20 62 6c 69 74 | 74 65 72 2e 20 20 54 68 |the blit|ter. Th|
|00001eb0| 65 20 6e 61 6d 65 20 6f | 66 20 74 68 69 73 20 66 |e name o|f this f|
|00001ec0| 69 6c 65 20 63 61 6e 0a | 62 65 20 73 70 65 63 69 |ile can.|be speci|
|00001ed0| 66 69 65 64 20 77 69 74 | 68 20 74 68 65 20 60 4c |fied wit|h the `L|
|00001ee0| 6f 67 27 20 73 74 72 69 | 6e 67 20 67 61 64 67 65 |og' stri|ng gadge|
|00001ef0| 74 3b 20 61 20 6e 75 6c | 6c 20 6e 61 6d 65 20 69 |t; a nul|l name i|
|00001f00| 6e 64 69 63 61 74 65 73 | 20 6e 6f 20 6c 6f 67 0a |ndicates| no log.|
|00001f10| 66 69 6c 65 20 69 73 20 | 74 6f 20 62 65 20 77 72 |file is |to be wr|
|00001f20| 69 74 74 65 6e 2e 0a 0a | 4e 6f 74 65 20 74 68 61 |itten...|Note tha|
|00001f30| 74 20 73 69 6d 75 6c 61 | 74 69 6f 6e 20 6f 66 20 |t simula|tion of |
|00001f40| 74 68 65 20 6c 69 6e 65 | 20 6d 6f 64 65 20 64 6f |the line| mode do|
|00001f50| 65 73 20 6e 6f 74 20 77 | 6f 72 6b 20 69 6e 20 76 |es not w|ork in v|
|00001f60| 65 72 73 69 6f 6e 20 31 | 2e 33 20 6f 66 0a 42 6c |ersion 1|.3 of.Bl|
|00001f70| 69 74 4c 61 62 2e 0a 0a | 5c 73 65 63 74 69 6f 6e |itLab...|\section|
|00001f80| 20 44 4d 41 20 43 68 61 | 6e 6e 65 6c 73 5c 5c 0a | DMA Cha|nnels\\.|
|00001f90| 0a 53 6f 20 6e 6f 77 20 | 77 65 20 68 61 76 65 20 |.So now |we have |
|00001fa0| 63 6f 6e 74 72 6f 6c 20 | 6f 66 20 74 68 65 20 62 |control |of the b|
|00001fb0| 6c 69 74 74 65 72 3b 20 | 77 65 20 63 61 6e 20 77 |litter; |we can w|
|00001fc0| 72 69 74 65 20 74 6f 20 | 61 6c 6c 20 6f 66 20 69 |rite to |all of i|
|00001fd0| 74 73 0a 72 65 67 69 73 | 74 65 72 73 20 61 6e 64 |ts.regis|ters and|
|00001fe0| 20 64 6f 20 77 68 61 74 | 65 76 65 72 20 77 65 20 | do what|ever we |
|00001ff0| 6c 69 6b 65 2e 20 20 42 | 65 66 6f 72 65 20 77 65 |like. B|efore we|
|00002000| 20 67 65 74 20 69 6e 74 | 6f 20 65 78 61 63 74 6c | get int|o exactl|
|00002010| 79 20 77 68 61 74 0a 77 | 65 20 63 61 6e 20 64 6f |y what.w|e can do|
|00002020| 2c 20 6c 65 74 20 6d 65 | 20 64 65 73 63 72 69 62 |, let me| describ|
|00002030| 65 20 74 68 65 20 62 6c | 69 74 74 65 72 20 44 4d |e the bl|itter DM|
|00002040| 41 20 63 68 61 6e 6e 65 | 6c 73 2e 0a 0a 41 73 20 |A channe|ls...As |
|00002050| 6d 65 6e 74 69 6f 6e 65 | 64 2c 20 74 68 65 20 62 |mentione|d, the b|
|00002060| 6c 69 74 74 65 72 20 68 | 61 73 20 66 6f 75 72 20 |litter h|as four |
|00002070| 44 4d 41 20 63 68 61 6e | 6e 65 6c 73 2c 20 41 2c |DMA chan|nels, A,|
|00002080| 20 42 2c 20 43 2c 20 61 | 6e 64 20 44 2e 0a 54 68 | B, C, a|nd D..Th|
|00002090| 65 73 65 20 61 72 65 20 | 73 68 6f 77 6e 20 69 6e |ese are |shown in|
|000020a0| 20 74 68 65 20 6c 6f 77 | 65 72 20 72 69 67 68 74 | the low|er right|
|000020b0| 20 68 61 6e 64 20 63 6f | 72 6e 65 72 20 6f 66 20 | hand co|rner of |
|000020c0| 74 68 65 20 42 6c 69 74 | 4c 61 62 20 64 69 73 70 |the Blit|Lab disp|
|000020d0| 6c 61 79 2e 0a 57 68 61 | 74 2c 20 79 6f 75 20 73 |lay..Wha|t, you s|
|000020e0| 61 79 20 79 6f 75 20 61 | 72 65 20 6e 6f 74 20 69 |ay you a|re not i|
|000020f0| 6e 20 42 6c 69 74 4c 61 | 62 20 79 65 74 3f 20 20 |n BlitLa|b yet? |
|00002100| 47 6f 20 74 6f 20 79 6f | 75 72 20 41 6d 69 67 61 |Go to yo|ur Amiga|
|00002110| 2c 20 70 6c 75 67 20 69 | 6e 0a 61 20 64 69 73 6b |, plug i|n.a disk|
|00002120| 20 77 69 74 68 20 42 6c | 69 74 4c 61 62 20 6f 6e | with Bl|itLab on|
|00002130| 20 69 74 2c 20 61 6e 64 | 20 7b 5c 74 74 20 72 75 | it, and| {\tt ru|
|00002140| 6e 20 62 6c 69 74 6c 61 | 62 7d 2e 20 20 54 68 65 |n blitla|b}. The|
|00002150| 20 72 65 73 74 20 6f 66 | 20 74 68 69 73 0a 6d 61 | rest of| this.ma|
|00002160| 6e 75 61 6c 20 61 73 73 | 75 6d 65 73 20 74 68 61 |nual ass|umes tha|
|00002170| 74 20 79 6f 75 20 68 61 | 76 65 20 64 6f 6e 65 20 |t you ha|ve done |
|00002180| 74 68 69 73 2e 20 20 49 | 66 20 79 6f 75 20 61 72 |this. I|f you ar|
|00002190| 65 20 72 75 6e 6e 69 6e | 67 20 61 6e 20 69 6e 74 |e runnin|g an int|
|000021a0| 65 72 6c 61 63 65 64 0a | 73 63 72 65 65 6e 20 6f |erlaced.|screen o|
|000021b0| 72 20 6f 64 64 20 63 6f | 6c 6f 72 73 2c 20 79 6f |r odd co|lors, yo|
|000021c0| 75 20 6d 69 67 68 74 20 | 66 69 6e 64 20 74 68 65 |u might |find the|
|000021d0| 20 42 6c 69 74 4c 61 62 | 20 64 69 73 70 6c 61 79 | BlitLab| display|
|000021e0| 20 76 69 73 75 61 6c 6c | 79 20 6a 61 72 72 69 6e | visuall|y jarrin|
|000021f0| 67 3b 0a 72 65 72 75 6e | 20 42 6c 69 74 4c 61 62 |g;.rerun| BlitLab|
|00002200| 20 77 69 74 68 20 74 68 | 65 20 63 6f 6d 6d 61 6e | with th|e comman|
|00002210| 64 20 7b 5c 74 74 20 72 | 75 6e 20 62 6c 69 74 6c |d {\tt r|un blitl|
|00002220| 61 62 20 2d 63 7d 20 74 | 6f 20 6f 70 65 6e 20 61 |ab -c} t|o open a|
|00002230| 20 63 75 73 74 6f 6d 0a | 73 63 72 65 65 6e 2e 0a | custom.|screen..|
|00002240| 0a 42 61 63 6b 20 74 6f | 20 74 68 65 20 44 4d 41 |.Back to| the DMA|
|00002250| 20 63 68 61 6e 6e 65 6c | 73 2e 0a 54 68 65 20 66 | channel|s..The f|
|00002260| 69 72 73 74 20 74 68 72 | 65 65 20 61 72 65 20 61 |irst thr|ee are a|
|00002270| 6c 77 61 79 73 20 73 6f | 75 72 63 65 73 2c 20 74 |lways so|urces, t|
|00002280| 68 65 20 6c 61 73 74 20 | 69 73 20 61 6c 77 61 79 |he last |is alway|
|00002290| 73 20 61 20 64 65 73 74 | 69 6e 61 74 69 6f 6e 2e |s a dest|ination.|
|000022a0| 0a 59 6f 75 20 63 61 6e | 20 75 73 65 20 61 6e 79 |.You can| use any|
|000022b0| 20 63 6f 6d 62 69 6e 61 | 74 69 6f 6e 20 6f 66 20 | combina|tion of |
|000022c0| 74 68 65 20 66 6f 75 72 | 20 63 68 61 6e 6e 65 6c |the four| channel|
|000022d0| 73 2c 20 66 72 6f 6d 20 | 6e 6f 6e 65 20 6f 66 20 |s, from |none of |
|000022e0| 74 68 65 6d 0a 74 6f 20 | 61 6c 6c 20 66 6f 75 72 |them.to |all four|
|000022f0| 2e 20 20 45 61 63 68 20 | 6f 66 20 74 68 65 20 66 |. Each |of the f|
|00002300| 6f 75 72 20 63 68 61 6e | 6e 65 6c 73 20 68 61 73 |our chan|nels has|
|00002310| 20 61 20 33 32 20 62 69 | 74 20 61 64 64 72 65 73 | a 32 bi|t addres|
|00002320| 73 20 70 6f 69 6e 74 65 | 72 20 77 68 69 63 68 0a |s pointe|r which.|
|00002330| 70 6f 69 6e 74 73 20 74 | 6f 20 74 68 65 20 6d 65 |points t|o the me|
|00002340| 6d 6f 72 79 20 69 74 20 | 77 69 6c 6c 20 75 73 65 |mory it |will use|
|00002350| 20 6f 72 20 6d 6f 64 69 | 66 79 2e 20 20 54 68 65 | or modi|fy. The|
|00002360| 20 6c 65 61 73 74 20 73 | 69 67 6e 69 66 69 63 61 | least s|ignifica|
|00002370| 6e 74 20 62 69 74 0a 6f | 66 20 74 68 65 20 6c 6f |nt bit.o|f the lo|
|00002380| 77 20 6f 72 64 65 72 20 | 77 6f 72 64 20 69 73 20 |w order |word is |
|00002390| 69 67 6e 6f 72 65 64 2e | 20 20 45 6e 6f 75 67 68 |ignored.| Enough|
|000023a0| 20 68 69 67 68 20 62 69 | 74 73 20 61 72 65 20 69 | high bi|ts are i|
|000023b0| 67 6e 6f 72 65 64 20 73 | 6f 20 6f 6e 6c 79 0a 43 |gnored s|o only.C|
|000023c0| 48 49 50 20 6d 65 6d 6f | 72 79 20 63 61 6e 20 62 |HIP memo|ry can b|
|000023d0| 65 20 61 63 63 65 73 73 | 65 64 3b 20 74 68 65 20 |e access|ed; the |
|000023e0| 63 75 72 72 65 6e 74 20 | 63 68 69 70 20 69 67 6e |current |chip ign|
|000023f0| 6f 72 65 73 20 74 68 65 | 20 74 6f 70 20 31 33 20 |ores the| top 13 |
|00002400| 62 69 74 73 2e 0a 45 61 | 63 68 20 63 68 61 6e 6e |bits..Ea|ch chann|
|00002410| 65 6c 20 61 6c 73 6f 20 | 68 61 73 20 61 6e 20 69 |el also |has an i|
|00002420| 6e 64 65 70 65 6e 64 65 | 6e 74 20 73 69 78 74 65 |ndepende|nt sixte|
|00002430| 65 6e 20 62 69 74 0a 73 | 69 67 6e 65 64 20 6d 6f |en bit.s|igned mo|
|00002440| 64 75 6c 6f 20 28 69 6e | 20 62 79 74 65 73 2c 20 |dulo (in| bytes, |
|00002450| 77 69 74 68 20 74 68 65 | 20 6c 65 61 73 74 20 73 |with the| least s|
|00002460| 69 67 6e 69 66 69 63 61 | 6e 74 20 62 69 74 20 61 |ignifica|nt bit a|
|00002470| 67 61 69 6e 20 69 67 6e | 6f 72 65 64 2e 29 0a 46 |gain ign|ored.).F|
|00002480| 6f 72 20 74 68 65 20 74 | 68 72 65 65 20 73 6f 75 |or the t|hree sou|
|00002490| 72 63 65 20 44 4d 41 20 | 63 68 61 6e 6e 65 6c 73 |rce DMA |channels|
|000024a0| 2c 20 74 68 65 72 65 20 | 69 73 20 61 6c 73 6f 20 |, there |is also |
|000024b0| 61 20 64 61 74 61 20 72 | 65 67 69 73 74 65 72 20 |a data r|egister |
|000024c0| 77 68 69 63 68 0a 79 6f | 75 20 63 61 6e 20 70 72 |which.yo|u can pr|
|000024d0| 65 6c 6f 61 64 20 77 69 | 74 68 20 63 6f 6e 73 74 |eload wi|th const|
|000024e0| 61 6e 74 20 64 61 74 61 | 20 69 66 20 74 68 65 20 |ant data| if the |
|000024f0| 44 4d 41 20 63 68 61 6e | 6e 65 6c 20 69 73 20 74 |DMA chan|nel is t|
|00002500| 75 72 6e 65 64 20 6f 66 | 66 2e 0a 0a 54 68 65 20 |urned of|f...The |
|00002510| 44 4d 41 20 63 68 61 6e | 6e 65 6c 73 20 73 68 61 |DMA chan|nels sha|
|00002520| 72 65 20 61 20 77 69 64 | 74 68 20 61 6e 64 20 61 |re a wid|th and a|
|00002530| 20 68 65 69 67 68 74 20 | 72 65 67 69 73 74 65 72 | height |register|
|00002540| 2e 20 20 54 68 65 0a 77 | 69 64 74 68 20 69 73 20 |. The.w|idth is |
|00002550| 69 6e 20 31 36 20 62 69 | 74 20 77 6f 72 64 73 2c |in 16 bi|t words,|
|00002560| 20 61 6e 64 20 63 61 6e | 20 74 61 6b 65 20 61 20 | and can| take a |
|00002570| 76 61 6c 75 65 20 66 72 | 6f 6d 20 31 20 74 6f 20 |value fr|om 1 to |
|00002580| 36 34 2e 20 20 54 68 65 | 20 68 65 69 67 68 74 0a |64. The| height.|
|00002590| 69 73 20 69 6e 20 70 69 | 78 65 6c 73 2c 20 61 6e |is in pi|xels, an|
|000025a0| 64 20 63 61 6e 20 74 61 | 6b 65 20 61 20 76 61 6c |d can ta|ke a val|
|000025b0| 75 65 20 66 72 6f 6d 20 | 31 20 74 6f 20 31 30 32 |ue from |1 to 102|
|000025c0| 34 2e 20 20 54 68 75 73 | 2c 20 74 68 65 20 6c 61 |4. Thus|, the la|
|000025d0| 72 67 65 73 74 0a 72 65 | 63 74 61 6e 67 75 6c 61 |rgest.re|ctangula|
|000025e0| 72 20 66 69 65 6c 64 20 | 6f 6e 20 77 68 69 63 68 |r field |on which|
|000025f0| 20 74 68 65 20 62 6c 69 | 74 74 65 72 20 63 61 6e | the bli|tter can|
|00002600| 20 64 69 72 65 63 74 6c | 79 20 6f 70 65 72 61 74 | directl|y operat|
|00002610| 65 20 69 73 20 31 30 32 | 34 20 62 79 0a 31 30 32 |e is 102|4 by.102|
|00002620| 34 2e 20 20 48 6f 77 65 | 76 65 72 2c 20 6c 61 72 |4. Howe|ver, lar|
|00002630| 67 65 72 20 66 69 65 6c | 64 73 20 63 61 6e 20 62 |ger fiel|ds can b|
|00002640| 65 20 68 61 6e 64 6c 65 | 64 20 62 79 20 73 70 6c |e handle|d by spl|
|00002650| 69 74 74 69 6e 67 20 61 | 20 62 6c 69 74 20 69 6e |itting a| blit in|
|00002660| 74 6f 0a 73 6d 61 6c 6c | 65 72 20 62 6c 69 74 73 |to.small|er blits|
|00002670| 2c 20 61 6e 64 20 75 73 | 69 6e 67 20 74 68 65 20 |, and us|ing the |
|00002680| 6d 6f 64 75 6c 6f 20 66 | 69 65 6c 64 73 20 61 70 |modulo f|ields ap|
|00002690| 70 72 6f 70 72 69 61 74 | 65 6c 79 2e 0a 0a 41 20 |propriat|ely...A |
|000026a0| 6b 65 79 20 74 68 69 6e | 67 20 74 6f 20 72 65 6d |key thin|g to rem|
|000026b0| 65 6d 62 65 72 20 68 65 | 72 65 20 69 73 20 74 68 |ember he|re is th|
|000026c0| 61 74 20 74 68 65 20 77 | 69 64 74 68 20 69 73 20 |at the w|idth is |
|000026d0| 69 6e 20 77 6f 72 64 73 | 2c 20 74 68 65 20 6d 6f |in words|, the mo|
|000026e0| 64 75 6c 6f 73 0a 61 6e | 64 20 70 6f 69 6e 74 65 |dulos.an|d pointe|
|000026f0| 72 73 20 61 72 65 20 69 | 6e 20 62 79 74 65 73 2c |rs are i|n bytes,|
|00002700| 20 61 6e 64 20 74 68 65 | 20 68 65 69 67 68 74 20 | and the| height |
|00002710| 69 73 20 69 6e 20 70 69 | 78 65 6c 73 2e 20 20 54 |is in pi|xels. T|
|00002720| 68 69 73 20 69 73 20 74 | 68 65 0a 6d 6f 73 74 20 |his is t|he.most |
|00002730| 63 6f 6d 6d 6f 6e 20 65 | 72 72 6f 72 20 6d 61 64 |common e|rror mad|
|00002740| 65 20 77 68 65 6e 20 75 | 73 69 6e 67 20 42 6c 69 |e when u|sing Bli|
|00002750| 74 4c 61 62 20 61 6e 64 | 20 74 68 65 20 62 6c 69 |tLab and| the bli|
|00002760| 74 74 65 72 2c 20 73 6f | 20 72 65 6d 65 6d 62 65 |tter, so| remembe|
|00002770| 72 21 0a 0a 5c 73 65 63 | 74 69 6f 6e 20 42 6c 6f |r!..\sec|tion Blo|
|00002780| 63 6b 20 43 6c 65 61 72 | 5c 5c 0a 0a 54 68 65 20 |ck Clear|\\..The |
|00002790| 64 65 73 74 69 6e 61 74 | 69 6f 6e 20 63 61 6e 20 |destinat|ion can |
|000027a0| 72 65 63 65 69 76 65 20 | 61 6e 79 20 6c 6f 67 69 |receive |any logi|
|000027b0| 63 61 6c 20 63 6f 6d 62 | 69 6e 61 74 69 6f 6e 20 |cal comb|ination |
|000027c0| 6f 66 20 69 74 73 20 74 | 68 72 65 65 20 73 6f 75 |of its t|hree sou|
|000027d0| 72 63 65 0a 6f 70 65 72 | 61 6e 64 73 2e 20 20 4c |rce.oper|ands. L|
|000027e0| 65 74 27 73 20 73 74 61 | 72 74 20 65 78 70 65 72 |et's sta|rt exper|
|000027f0| 69 6d 65 6e 74 69 6e 67 | 2e 0a 46 69 72 73 74 20 |imenting|..First |
|00002800| 77 65 20 77 69 6c 6c 20 | 74 72 79 20 74 6f 20 63 |we will |try to c|
|00002810| 6c 65 61 72 20 6d 65 6d | 6f 72 79 2e 20 20 54 68 |lear mem|ory. Th|
|00002820| 65 20 6c 61 72 67 65 20 | 72 65 63 74 61 6e 67 6c |e large |rectangl|
|00002830| 65 20 69 6e 20 74 68 65 | 20 75 70 70 65 72 0a 6c |e in the| upper.l|
|00002840| 65 66 74 20 68 61 6e 64 | 20 63 6f 72 6e 65 72 20 |eft hand| corner |
|00002850| 6f 66 20 74 68 65 20 42 | 6c 69 74 4c 61 62 20 77 |of the B|litLab w|
|00002860| 69 6e 64 6f 77 20 69 73 | 20 74 68 65 20 62 69 74 |indow is| the bit|
|00002870| 20 72 65 67 69 6f 6e 20 | 77 65 20 63 61 6e 20 65 | region |we can e|
|00002880| 78 70 65 72 69 6d 65 6e | 74 20 77 69 74 68 2e 0a |xperimen|t with..|
|00002890| 4c 65 74 27 73 20 73 65 | 74 20 73 6f 6d 65 20 72 |Let's se|t some r|
|000028a0| 61 6e 64 6f 6d 20 62 69 | 74 73 20 66 6f 72 20 74 |andom bi|ts for t|
|000028b0| 68 65 20 62 6c 69 74 74 | 65 72 20 74 6f 20 63 6c |he blitt|er to cl|
|000028c0| 65 61 72 2e 20 20 4d 6f | 76 65 0a 74 68 65 20 6d |ear. Mo|ve.the m|
|000028d0| 6f 75 73 65 20 69 6e 74 | 6f 20 74 68 65 20 62 6c |ouse int|o the bl|
|000028e0| 61 63 6b 20 72 65 63 74 | 61 6e 67 6c 65 2c 20 68 |ack rect|angle, h|
|000028f0| 6f 6c 64 20 64 6f 77 6e | 20 74 68 65 20 6c 65 66 |old down| the lef|
|00002900| 74 20 6d 6f 75 73 65 20 | 62 75 74 74 6f 6e 2c 20 |t mouse |button, |
|00002910| 61 6e 64 0a 6d 6f 76 65 | 20 74 68 65 20 6d 6f 75 |and.move| the mou|
|00002920| 73 65 20 61 72 6f 75 6e | 64 2e 20 20 53 65 74 20 |se aroun|d. Set |
|00002930| 70 69 78 65 6c 73 20 75 | 6e 74 69 6c 20 79 6f 75 |pixels u|ntil you|
|00002940| 20 74 69 72 65 20 6f 66 | 20 74 68 65 20 6e 6f 76 | tire of| the nov|
|00002950| 65 6c 74 79 2e 20 20 4e | 6f 74 65 0a 74 68 61 74 |elty. N|ote.that|
|00002960| 20 61 73 20 79 6f 75 20 | 6d 6f 76 65 20 74 68 65 | as you |move the|
|00002970| 20 6d 6f 75 73 65 2c 20 | 74 68 65 20 41 64 72 73 | mouse, |the Adrs|
|00002980| 20 61 6e 64 20 53 68 69 | 66 74 20 66 69 65 6c 64 | and Shi|ft field|
|00002990| 73 20 63 68 61 6e 67 65 | 3b 20 74 68 65 73 65 20 |s change|; these |
|000029a0| 77 69 6c 6c 0a 62 65 20 | 75 73 65 66 75 6c 20 69 |will.be |useful i|
|000029b0| 6e 20 61 20 73 65 63 6f | 6e 64 2e 20 20 54 6f 20 |n a seco|nd. To |
|000029c0| 63 6c 65 61 72 20 70 69 | 78 65 6c 73 2c 20 68 6f |clear pi|xels, ho|
|000029d0| 6c 64 20 64 6f 77 6e 20 | 74 68 65 20 72 69 67 68 |ld down |the righ|
|000029e0| 74 20 6d 6f 75 73 65 20 | 62 75 74 74 6f 6e 0a 69 |t mouse |button.i|
|000029f0| 6e 73 74 65 61 64 20 6f | 66 20 74 68 65 20 6c 65 |nstead o|f the le|
|00002a00| 66 74 2e 0a 0a 4f 6e 63 | 65 20 79 6f 75 20 68 61 |ft...Onc|e you ha|
|00002a10| 76 65 20 61 20 72 65 61 | 73 6f 6e 61 62 6c 65 20 |ve a rea|sonable |
|00002a20| 6e 75 6d 62 65 72 20 6f | 66 20 70 69 78 65 6c 73 |number o|f pixels|
|00002a30| 20 6f 6e 20 74 68 65 20 | 73 63 72 65 65 6e 2c 20 | on the |screen, |
|00002a40| 79 6f 75 20 61 72 65 20 | 72 65 61 64 79 0a 74 6f |you are |ready.to|
|00002a50| 20 62 65 67 69 6e 2e 20 | 20 54 6f 20 65 6e 74 65 | begin. | To ente|
|00002a60| 72 20 64 61 74 61 20 69 | 6e 74 6f 20 61 20 73 74 |r data i|nto a st|
|00002a70| 72 69 6e 67 20 67 61 64 | 67 65 74 2c 20 73 65 6c |ring gad|get, sel|
|00002a80| 65 63 74 20 74 68 65 20 | 73 74 72 69 6e 67 20 67 |ect the |string g|
|00002a90| 61 64 67 65 74 2c 0a 62 | 61 63 6b 73 70 61 63 65 |adget,.b|ackspace|
|00002aa0| 20 6f 76 65 72 20 74 68 | 65 20 6f 6c 64 20 64 61 | over th|e old da|
|00002ab0| 74 61 2c 0a 74 79 70 65 | 20 6e 65 77 20 64 61 74 |ta,.type| new dat|
|00002ac0| 61 2c 20 61 6e 64 20 74 | 68 65 6e 20 68 69 74 20 |a, and t|hen hit |
|00002ad0| 72 65 74 75 72 6e 2e 20 | 20 46 69 72 73 74 2c 20 |return. | First, |
|00002ae0| 69 6e 20 74 68 65 20 67 | 61 64 67 65 74 20 6d 61 |in the g|adget ma|
|00002af0| 72 6b 65 64 20 57 2c 0a | 65 6e 74 65 72 20 74 68 |rked W,.|enter th|
|00002b00| 65 20 6e 75 6d 62 65 72 | 20 5c 2e 7b 36 7d 2e 20 |e number| \.{6}. |
|00002b10| 20 54 68 65 20 66 69 65 | 6c 64 20 77 65 20 61 72 | The fie|ld we ar|
|00002b20| 65 20 77 6f 72 6b 69 6e | 67 20 6f 6e 20 69 73 20 |e workin|g on is |
|00002b30| 39 36 20 70 69 78 65 6c | 73 20 77 69 64 65 20 62 |96 pixel|s wide b|
|00002b40| 79 0a 33 32 20 70 69 78 | 65 6c 73 20 68 69 67 68 |y.32 pix|els high|
|00002b50| 3b 20 74 68 61 74 20 69 | 73 20 73 69 78 20 77 6f |; that i|s six wo|
|00002b60| 72 64 73 20 62 79 20 33 | 32 20 72 6f 77 73 2e 20 |rds by 3|2 rows. |
|00002b70| 20 45 6e 74 65 72 20 5c | 2e 7b 33 32 7d 20 69 6e | Enter \|.{32} in|
|00002b80| 74 6f 20 74 68 65 20 48 | 20 67 61 64 67 65 74 2e |to the H| gadget.|
|00002b90| 0a 4e 6f 77 2c 20 74 75 | 72 6e 20 6f 6e 20 74 68 |.Now, tu|rn on th|
|00002ba0| 65 20 44 20 44 4d 41 20 | 63 68 61 6e 6e 65 6c 20 |e D DMA |channel |
|00002bb0| 62 79 20 73 65 6c 65 63 | 74 69 6e 67 20 74 68 65 |by selec|ting the|
|00002bc0| 20 67 61 64 67 65 74 20 | 6d 61 72 6b 65 64 20 60 | gadget |marked `|
|00002bd0| 4e 27 20 69 6e 0a 74 68 | 65 20 44 20 72 6f 77 3b |N' in.th|e D row;|
|00002be0| 20 69 74 20 73 68 6f 75 | 6c 64 20 74 6f 67 67 6c | it shou|ld toggl|
|00002bf0| 65 20 61 6e 64 20 73 68 | 6f 77 20 60 59 27 2e 20 |e and sh|ow `Y'. |
|00002c00| 20 45 6e 74 65 72 20 5c | 2e 7b 4d 7d 20 69 6e 74 | Enter \|.{M} int|
|00002c10| 6f 20 74 68 65 20 50 54 | 20 63 6f 6c 75 6d 6e 0a |o the PT| column.|
|00002c20| 6f 6e 20 74 68 65 20 44 | 20 72 6f 77 3b 20 74 68 |on the D| row; th|
|00002c30| 69 73 20 69 73 20 74 68 | 65 0a 73 79 6d 62 6f 6c |is is th|e.symbol|
|00002c40| 69 63 20 6e 61 6d 65 20 | 66 6f 72 20 74 68 65 20 |ic name |for the |
|00002c50| 61 64 64 72 65 73 73 20 | 6f 66 20 74 68 65 20 72 |address |of the r|
|00002c60| 65 63 74 61 6e 67 6c 65 | 20 77 65 20 61 72 65 20 |ectangle| we are |
|00002c70| 65 78 70 65 72 69 6d 65 | 6e 74 69 6e 67 0a 77 69 |experime|nting.wi|
|00002c80| 74 68 2e 20 20 45 6e 74 | 65 72 20 5c 2e 7b 30 7d |th. Ent|er \.{0}|
|00002c90| 20 69 6e 74 6f 20 74 68 | 65 20 60 46 75 6e 63 74 | into th|e `Funct|
|00002ca0| 69 6f 6e 27 20 67 61 64 | 67 65 74 20 6e 65 61 72 |ion' gad|get near|
|00002cb0| 20 74 68 65 20 63 65 6e | 74 65 72 20 6f 66 20 74 | the cen|ter of t|
|00002cc0| 68 65 20 77 69 6e 64 6f | 77 2e 0a 57 65 20 61 72 |he windo|w..We ar|
|00002cd0| 65 20 72 65 61 64 79 20 | 74 6f 20 67 6f 2e 20 20 |e ready |to go. |
|00002ce0| 41 74 20 74 68 69 73 20 | 70 6f 69 6e 74 2c 20 73 |At this |point, s|
|00002cf0| 65 6c 65 63 74 20 74 68 | 65 20 60 43 61 6c 63 27 |elect th|e `Calc'|
|00002d00| 20 67 61 64 67 65 74 2e | 0a 42 6c 69 74 4c 61 62 | gadget.|.BlitLab|
|00002d10| 20 77 69 6c 6c 20 72 65 | 61 64 20 74 68 65 20 76 | will re|ad the v|
|00002d20| 61 6c 75 65 73 20 79 6f | 75 20 68 61 76 65 20 65 |alues yo|u have e|
|00002d30| 6e 74 65 72 65 64 20 61 | 6e 64 20 6d 61 6b 65 20 |ntered a|nd make |
|00002d40| 73 75 72 65 20 74 68 61 | 74 20 79 6f 75 0a 61 72 |sure tha|t you.ar|
|00002d50| 65 20 6e 6f 74 20 67 6f | 69 6e 67 20 74 6f 20 63 |e not go|ing to c|
|00002d60| 6c 6f 62 62 65 72 20 74 | 68 65 20 73 79 73 74 65 |lobber t|he syste|
|00002d70| 6d 2e 20 20 49 66 20 74 | 68 65 20 62 6c 69 74 20 |m. If t|he blit |
|00002d80| 69 73 20 73 61 66 65 2c | 20 69 74 20 77 69 6c 6c |is safe,| it will|
|00002d90| 20 73 61 79 0a 73 6f 3b | 20 6f 74 68 65 72 77 69 | say.so;| otherwi|
|00002da0| 73 65 20 69 74 20 77 69 | 6c 6c 20 70 72 69 6e 74 |se it wi|ll print|
|00002db0| 20 61 6e 20 65 72 72 6f | 72 20 6d 65 73 73 61 67 | an erro|r messag|
|00002dc0| 65 20 6f 6e 20 74 68 65 | 20 77 69 6e 64 6f 77 20 |e on the| window |
|00002dd0| 74 69 74 6c 65 0a 62 61 | 72 2e 20 20 49 66 20 79 |title.ba|r. If y|
|00002de0| 6f 75 20 67 65 74 20 74 | 68 65 20 65 72 72 6f 72 |ou get t|he error|
|00002df0| 20 6d 65 73 73 61 67 65 | 2c 20 69 74 20 69 73 20 | message|, it is |
|00002e00| 6c 69 6b 65 6c 79 20 74 | 68 61 74 20 79 6f 75 72 |likely t|hat your|
|00002e10| 20 6d 61 63 68 69 6e 65 | 20 77 69 6c 6c 0a 63 72 | machine| will.cr|
|00002e20| 61 73 68 20 69 66 20 79 | 6f 75 20 61 73 6b 20 69 |ash if y|ou ask i|
|00002e30| 74 20 74 6f 20 70 65 72 | 66 6f 72 6d 20 74 68 65 |t to per|form the|
|00002e40| 20 62 6c 69 74 2e 0a 0a | 4f 74 68 65 72 77 69 73 | blit...|Otherwis|
|00002e50| 65 2c 20 67 6f 20 61 68 | 65 61 64 20 61 6e 64 20 |e, go ah|ead and |
|00002e60| 73 65 6c 65 63 74 20 74 | 68 65 20 60 47 4f 27 20 |select t|he `GO' |
|00002e70| 67 61 64 67 65 74 2e 20 | 20 54 68 65 20 70 69 78 |gadget. | The pix|
|00002e80| 65 6c 73 20 79 6f 75 20 | 73 6f 0a 6c 61 62 6f 72 |els you |so.labor|
|00002e90| 69 6f 75 73 6c 79 20 73 | 65 74 20 73 68 6f 75 6c |iously s|et shoul|
|00002ea0| 64 20 64 69 73 61 70 70 | 65 61 72 2e 20 20 43 6f |d disapp|ear. Co|
|00002eb0| 6e 67 72 61 74 75 6c 61 | 74 69 6f 6e 73 2c 20 79 |ngratula|tions, y|
|00002ec0| 6f 75 20 68 61 76 65 20 | 70 65 72 66 6f 72 6d 65 |ou have |performe|
|00002ed0| 64 0a 79 6f 75 72 20 66 | 69 72 73 74 20 62 6c 69 |d.your f|irst bli|
|00002ee0| 74 21 0a 0a 59 6f 75 20 | 6d 61 79 20 68 61 76 65 |t!..You |may have|
|00002ef0| 20 6e 6f 74 69 63 65 64 | 20 74 68 61 74 20 74 68 | noticed| that th|
|00002f00| 65 20 70 69 78 65 6c 73 | 20 61 63 74 75 61 6c 6c |e pixels| actuall|
|00002f10| 79 20 64 69 73 61 70 70 | 65 61 72 65 64 20 72 61 |y disapp|eared ra|
|00002f20| 74 68 65 72 0a 73 6c 6f | 77 6c 79 2e 20 20 49 66 |ther.slo|wly. If|
|00002f30| 20 74 68 69 73 20 69 73 | 20 74 68 65 20 63 61 73 | this is| the cas|
|00002f40| 65 2c 20 79 6f 75 20 68 | 61 76 65 20 61 20 64 65 |e, you h|ave a de|
|00002f50| 66 65 63 74 69 76 65 20 | 41 6d 69 67 61 2e 20 20 |fective |Amiga. |
|00002f60| 4e 6f 2c 20 61 63 74 75 | 61 6c 6c 79 0a 74 68 69 |No, actu|ally.thi|
|00002f70| 73 20 69 73 20 61 6e 20 | 61 72 74 69 66 61 63 74 |s is an |artifact|
|00002f80| 20 6f 66 20 74 68 65 20 | 70 72 6f 67 72 61 6d 3b | of the |program;|
|00002f90| 20 42 6c 69 74 4c 61 62 | 20 69 73 20 70 65 72 66 | BlitLab| is perf|
|00002fa0| 6f 72 6d 69 6e 67 20 74 | 68 65 20 62 6c 69 74 73 |orming t|he blits|
|00002fb0| 0a 69 6e 20 73 6f 6d 65 | 20 6f 74 68 65 72 20 6d |.in some| other m|
|00002fc0| 65 6d 6f 72 79 20 73 6f | 6d 65 77 68 65 72 65 2c |emory so|mewhere,|
|00002fd0| 20 61 6e 64 20 74 68 65 | 6e 20 63 6f 70 79 69 6e | and the|n copyin|
|00002fe0| 67 20 61 6e 64 20 65 78 | 70 61 6e 64 69 6e 67 20 |g and ex|panding |
|00002ff0| 74 68 65 20 62 69 74 73 | 0a 74 6f 20 74 68 65 20 |the bits|.to the |
|00003000| 72 65 63 74 61 6e 67 6c | 65 20 64 69 73 70 6c 61 |rectangl|e displa|
|00003010| 79 65 64 20 6f 6e 20 74 | 68 65 20 73 63 72 65 65 |yed on t|he scree|
|00003020| 6e 2e 20 20 49 74 20 69 | 73 20 74 68 69 73 20 75 |n. It i|s this u|
|00003030| 70 64 61 74 69 6e 67 20 | 61 6e 64 0a 65 78 70 61 |pdating |and.expa|
|00003040| 6e 64 69 6e 67 20 74 68 | 61 74 20 69 73 20 73 6c |nding th|at is sl|
|00003050| 6f 77 2c 20 6e 6f 74 20 | 74 68 65 20 62 6c 69 74 |ow, not |the blit|
|00003060| 2e 20 20 53 6f 20 64 6f | 6e 27 74 20 62 65 20 61 |. So do|n't be a|
|00003070| 6c 61 72 6d 65 64 2e 0a | 0a 42 65 66 6f 72 65 20 |larmed..|.Before |
|00003080| 77 65 20 67 65 74 20 73 | 74 65 65 70 65 64 20 69 |we get s|teeped i|
|00003090| 6e 20 65 78 70 6c 61 6e | 61 74 69 6f 6e 73 2c 20 |n explan|ations, |
|000030a0| 6c 65 74 27 73 20 65 78 | 70 65 72 69 6d 65 6e 74 |let's ex|periment|
|000030b0| 20 73 6f 6d 65 20 6d 6f | 72 65 2e 0a 53 65 74 20 | some mo|re..Set |
|000030c0| 74 68 65 20 60 46 75 6e | 63 74 69 6f 6e 27 20 74 |the `Fun|ction' t|
|000030d0| 6f 20 5c 2e 7b 32 35 35 | 7d 2c 20 61 6e 64 20 68 |o \.{255|}, and h|
|000030e0| 69 74 20 60 47 4f 27 20 | 61 67 61 69 6e 2e 20 20 |it `GO' |again. |
|000030f0| 54 68 69 73 20 73 68 6f | 75 6c 64 20 73 65 74 20 |This sho|uld set |
|00003100| 61 6c 6c 20 6f 66 0a 74 | 68 65 20 70 69 78 65 6c |all of.t|he pixel|
|00003110| 73 20 69 6e 20 6f 75 72 | 20 72 65 63 74 61 6e 67 |s in our| rectang|
|00003120| 6c 65 2e 20 20 53 65 74 | 20 69 74 20 62 61 63 6b |le. Set| it back|
|00003130| 20 74 6f 20 5c 2e 7b 30 | 7d 2c 20 61 6e 64 20 73 | to \.{0|}, and s|
|00003140| 65 74 20 74 68 65 20 68 | 65 69 67 68 74 20 74 6f |et the h|eight to|
|00003150| 0a 5c 2e 7b 31 36 7d 2e | 20 20 4e 6f 77 2c 20 6f |.\.{16}.| Now, o|
|00003160| 6e 6c 79 20 68 61 6c 66 | 20 6f 66 20 74 68 65 20 |nly half| of the |
|00003170| 72 65 63 74 61 6e 67 6c | 65 20 69 73 20 63 6c 65 |rectangl|e is cle|
|00003180| 61 72 65 64 2e 20 20 53 | 65 74 20 74 68 65 20 6d |ared. S|et the m|
|00003190| 6f 64 75 6c 6f 20 28 66 | 6f 72 0a 74 68 65 20 44 |odulo (f|or.the D|
|000031a0| 20 63 68 61 6e 6e 65 6c | 29 20 74 6f 20 5c 2e 7b | channel|) to \.{|
|000031b0| 36 7d 20 28 62 79 74 65 | 73 29 2c 20 61 6e 64 20 |6} (byte|s), and |
|000031c0| 72 65 64 75 63 65 20 74 | 68 65 20 77 69 64 74 68 |reduce t|he width|
|000031d0| 20 74 6f 20 5c 2e 7b 33 | 7d 20 28 77 6f 72 64 73 | to \.{3|} (words|
|000031e0| 2c 0a 72 65 6d 65 6d 62 | 65 72 3f 29 20 20 53 65 |,.rememb|er?) Se|
|000031f0| 74 20 74 68 65 20 60 46 | 75 6e 63 74 69 6f 6e 27 |t the `F|unction'|
|00003200| 0a 62 61 63 6b 20 74 6f | 20 5c 2e 7b 32 35 35 7d |.back to| \.{255}|
|00003210| 2c 20 61 6e 64 20 60 47 | 4f 27 2e 20 20 4e 6f 77 |, and `G|O'. Now|
|00003220| 20 74 68 65 20 75 70 70 | 65 72 20 6c 65 66 74 20 | the upp|er left |
|00003230| 63 6f 72 6e 65 72 20 6f | 66 20 74 68 65 20 72 65 |corner o|f the re|
|00003240| 63 74 61 6e 67 6c 65 20 | 69 73 0a 63 6c 65 61 72 |ctangle |is.clear|
|00003250| 65 64 2e 0a 0a 4f 6f 70 | 73 2c 20 77 65 20 61 72 |ed...Oop|s, we ar|
|00003260| 65 20 70 72 6f 62 61 62 | 6c 79 20 67 65 74 74 69 |e probab|ly getti|
|00003270| 6e 67 20 61 68 65 61 64 | 20 6f 66 20 6f 75 72 73 |ng ahead| of ours|
|00003280| 65 6c 76 65 73 20 68 65 | 72 65 2e 20 20 46 6f 72 |elves he|re. For|
|00003290| 20 6e 6f 77 2c 20 6a 75 | 73 74 0a 74 61 6b 65 20 | now, ju|st.take |
|000032a0| 6d 79 20 77 6f 72 64 20 | 66 6f 72 20 74 68 65 20 |my word |for the |
|000032b0| 66 61 63 74 20 74 68 61 | 74 20 73 65 74 74 69 6e |fact tha|t settin|
|000032c0| 67 20 74 68 65 20 66 75 | 6e 63 74 69 6f 6e 20 74 |g the fu|nction t|
|000032d0| 6f 20 5c 2e 7b 30 7d 20 | 63 6c 65 61 72 73 20 74 |o \.{0} |clears t|
|000032e0| 68 65 0a 64 65 73 74 69 | 6e 61 74 69 6f 6e 2c 20 |he.desti|nation, |
|000032f0| 61 6e 64 20 73 65 74 74 | 69 6e 67 20 74 68 65 20 |and sett|ing the |
|00003300| 66 75 6e 63 74 69 6f 6e | 20 74 6f 20 5c 2e 7b 32 |function| to \.{2|
|00003310| 35 35 7d 20 73 65 74 73 | 20 61 6c 6c 20 6f 66 20 |55} sets| all of |
|00003320| 74 68 65 20 62 69 74 73 | 20 69 6e 0a 74 68 65 20 |the bits| in.the |
|00003330| 64 65 73 74 69 6e 61 74 | 69 6f 6e 2e 20 20 49 20 |destinat|ion. I |
|00003340| 61 6d 20 73 75 72 65 20 | 74 68 65 20 77 69 64 74 |am sure |the widt|
|00003350| 68 20 61 6e 64 20 68 65 | 69 67 68 74 20 28 74 68 |h and he|ight (th|
|00003360| 61 74 27 73 20 74 68 65 | 20 57 20 61 6e 64 20 48 |at's the| W and H|
|00003370| 0a 67 61 64 67 65 74 73 | 29 20 65 78 70 6c 61 69 |.gadgets|) explai|
|00003380| 6e 20 74 68 65 6d 73 65 | 6c 76 65 73 20 77 65 6c |n themse|lves wel|
|00003390| 6c 20 65 6e 6f 75 67 68 | 2c 20 61 73 20 64 6f 65 |l enough|, as doe|
|000033a0| 73 20 74 68 65 20 61 64 | 64 72 65 73 73 20 70 6f |s the ad|dress po|
|000033b0| 69 6e 74 65 72 0a 28 74 | 68 61 74 27 73 20 50 54 |inter.(t|hat's PT|
|000033c0| 2e 29 20 20 42 75 74 2c | 20 68 6f 77 20 69 73 20 |.) But,| how is |
|000033d0| 74 68 65 20 6d 6f 64 75 | 6c 6f 20 69 6e 74 65 72 |the modu|lo inter|
|000033e0| 70 72 65 74 65 64 3f 0a | 0a 54 68 65 20 61 6c 67 |preted?.|.The alg|
|000033f0| 6f 72 69 74 68 6d 20 74 | 68 65 20 62 6c 69 74 74 |orithm t|he blitt|
|00003400| 65 72 20 75 73 65 73 20 | 74 6f 20 64 6f 20 61 20 |er uses |to do a |
|00003410| 62 6c 69 74 20 6c 6f 6f | 6b 73 20 73 6f 6d 65 74 |blit loo|ks somet|
|00003420| 68 69 6e 67 20 6c 69 6b | 65 20 74 68 69 73 3a 0a |hing lik|e this:.|
|00003430| 0a 5c 62 76 0a 64 6f 62 | 6c 69 74 28 64 61 64 64 |.\bv.dob|lit(dadd|
|00003440| 72 65 73 73 2c 20 68 65 | 69 67 68 74 2c 20 77 69 |ress, he|ight, wi|
|00003450| 64 74 68 2c 20 64 6d 6f | 64 75 6c 6f 29 0a 63 68 |dth, dmo|dulo).ch|
|00003460| 61 72 20 2a 64 61 64 64 | 72 65 73 73 20 3b 0a 69 |ar *dadd|ress ;.i|
|00003470| 6e 74 20 68 65 69 67 68 | 74 2c 20 77 69 64 74 68 |nt heigh|t, width|
|00003480| 2c 20 64 6d 6f 64 75 6c | 6f 20 3b 0a 7b 0a 20 20 |, dmodul|o ;.{. |
|00003490| 20 69 6e 74 20 68 2c 20 | 76 20 3b 0a 20 20 20 66 | int h, |v ;. f|
|000034a0| 6f 72 20 28 76 3d 30 3b | 20 76 3c 68 65 69 67 68 |or (v=0;| v<heigh|
|000034b0| 74 3b 20 76 2b 2b 29 20 | 7b 0a 20 20 20 20 20 20 |t; v++) |{. |
|000034c0| 66 6f 72 20 28 68 3d 30 | 3b 20 68 3c 77 69 64 74 |for (h=0|; h<widt|
|000034d0| 68 3b 20 68 2b 2b 29 20 | 7b 0a 20 20 20 20 20 20 |h; h++) |{. |
|000034e0| 20 20 20 2a 64 61 64 64 | 72 65 73 73 20 3d 20 66 | *dadd|ress = f|
|000034f0| 75 6e 63 74 69 6f 6e 28 | 29 20 3b 0a 20 20 20 20 |unction(|) ;. |
|00003500| 20 20 20 20 20 64 61 64 | 64 72 65 73 73 20 2b 3d | dad|dress +=|
|00003510| 20 32 20 3b 0a 20 20 20 | 20 20 20 7d 0a 20 20 20 | 2 ;. | }. |
|00003520| 20 20 20 64 61 64 64 72 | 65 73 73 20 2b 3d 20 64 | daddr|ess += d|
|00003530| 6d 6f 64 75 6c 6f 20 3b | 0a 20 20 20 7d 0a 7d 0a |modulo ;|. }.}.|
|00003540| 24 65 6e 64 76 65 72 62 | 0a 5c 6e 6f 69 6e 64 65 |$endverb|.\noinde|
|00003550| 6e 74 0a 28 53 65 65 20 | 74 68 65 20 61 70 70 65 |nt.(See |the appe|
|00003560| 6e 64 69 78 20 66 6f 72 | 20 61 20 6d 6f 72 65 20 |ndix for| a more |
|00003570| 64 65 74 61 69 6c 65 64 | 20 62 6c 69 74 74 65 72 |detailed| blitter|
|00003580| 20 65 6d 75 6c 61 74 6f | 72 2e 29 0a 48 65 72 65 | emulato|r.).Here|
|00003590| 20 5c 62 20 66 75 6e 63 | 74 69 6f 6e 28 29 20 63 | \b func|tion() c|
|000035a0| 61 6c 63 75 6c 61 74 65 | 73 20 74 68 65 20 64 61 |alculate|s the da|
|000035b0| 74 61 20 74 6f 20 62 65 | 20 73 74 6f 72 65 64 3b |ta to be| stored;|
|000035c0| 20 69 74 20 77 69 6c 6c | 20 62 65 20 64 65 73 63 | it will| be desc|
|000035d0| 72 69 62 65 64 0a 6c 61 | 74 65 72 2e 20 20 41 20 |ribed.la|ter. A |
|000035e0| 72 6f 77 20 63 6f 6e 73 | 69 73 74 73 20 6f 66 20 |row cons|ists of |
|000035f0| 5c 2e 7b 77 69 64 74 68 | 7d 20 31 36 20 62 69 74 |\.{width|} 16 bit|
|00003600| 20 77 6f 72 64 73 2c 20 | 65 61 63 68 20 6f 66 20 | words, |each of |
|00003610| 77 68 69 63 68 20 61 72 | 65 20 6d 6f 64 69 66 69 |which ar|e modifi|
|00003620| 65 64 0a 69 6e 20 74 75 | 72 6e 2c 20 69 6e 63 72 |ed.in tu|rn, incr|
|00003630| 65 6d 65 6e 74 69 6e 67 | 20 74 68 65 20 61 64 64 |ementing| the add|
|00003640| 72 65 73 73 20 70 6f 69 | 6e 74 65 72 20 74 6f 20 |ress poi|nter to |
|00003650| 74 68 65 20 6e 65 78 74 | 20 77 6f 72 64 2e 0a 41 |the next| word..A|
|00003660| 66 74 65 72 20 61 20 72 | 6f 77 2c 20 74 68 65 20 |fter a r|ow, the |
|00003670| 76 61 6c 75 65 20 5c 2e | 7b 64 6d 6f 64 75 6c 6f |value \.|{dmodulo|
|00003680| 7d 20 69 73 20 61 64 64 | 65 64 20 74 6f 20 74 68 |} is add|ed to th|
|00003690| 65 20 61 64 64 72 65 73 | 73 2e 20 20 54 68 75 73 |e addres|s. Thus|
|000036a0| 2c 20 69 66 20 79 6f 75 | 72 0a 62 69 74 6d 61 70 |, if you|r.bitmap|
|000036b0| 20 69 73 20 5c 2e 7b 6e | 7d 20 77 6f 72 64 73 20 | is \.{n|} words |
|000036c0| 77 69 64 65 2c 20 5c 2e | 7b 32 2a 77 69 64 74 68 |wide, \.|{2*width|
|000036d0| 2b 64 6d 6f 64 75 6c 6f | 7d 20 73 68 6f 75 6c 64 |+dmodulo|} should|
|000036e0| 20 61 6c 77 61 79 73 20 | 65 71 75 61 6c 20 5c 2e | always |equal \.|
|000036f0| 7b 6e 7d 2e 0a 0a 5c 73 | 65 63 74 69 6f 6e 20 4d |{n}...\s|ection M|
|00003700| 65 6d 6f 72 79 20 43 6f | 70 79 5c 5c 0a 0a 43 6c |emory Co|py\\..Cl|
|00003710| 65 61 72 20 74 68 65 20 | 72 65 63 74 61 6e 67 6c |ear the |rectangl|
|00003720| 65 20 61 67 61 69 6e 2e | 20 20 54 68 69 73 20 74 |e again.| This t|
|00003730| 69 6d 65 20 64 6f 20 69 | 74 20 77 69 74 68 20 74 |ime do i|t with t|
|00003740| 68 65 20 6d 6f 75 73 65 | 3b 20 73 65 6c 65 63 74 |he mouse|; select|
|00003750| 20 74 68 65 0a 67 61 64 | 67 65 74 20 6d 61 72 6b | the.gad|get mark|
|00003760| 65 64 20 60 50 6f 69 6e | 74 27 2c 20 69 74 20 73 |ed `Poin|t', it s|
|00003770| 68 6f 75 6c 64 20 74 6f | 67 67 6c 65 20 74 6f 20 |hould to|ggle to |
|00003780| 60 42 6f 78 27 2e 20 20 | 4d 6f 76 65 20 74 68 65 |`Box'. |Move the|
|00003790| 20 6d 6f 75 73 65 0a 74 | 6f 20 74 68 65 20 75 70 | mouse.t|o the up|
|000037a0| 70 65 72 20 6c 65 66 74 | 20 63 6f 72 6e 65 72 20 |per left| corner |
|000037b0| 6f 66 20 74 68 65 20 72 | 65 63 74 61 6e 67 6c 65 |of the r|ectangle|
|000037c0| 2c 20 70 72 65 73 73 20 | 74 68 65 20 72 69 67 68 |, press |the righ|
|000037d0| 74 20 6d 6f 75 73 65 20 | 62 75 74 74 6f 6e 2c 0a |t mouse |button,.|
|000037e0| 61 6e 64 20 64 72 61 67 | 20 74 68 65 20 6d 6f 75 |and drag| the mou|
|000037f0| 73 65 20 74 6f 20 74 68 | 65 20 6c 6f 77 65 72 20 |se to th|e lower |
|00003800| 72 69 67 68 74 20 63 6f | 72 6e 65 72 20 6f 66 20 |right co|rner of |
|00003810| 74 68 65 20 72 65 63 74 | 61 6e 67 6c 65 2c 20 68 |the rect|angle, h|
|00003820| 6f 6c 64 69 6e 67 0a 74 | 68 65 20 6d 6f 75 73 65 |olding.t|he mouse|
|00003830| 20 62 75 74 74 6f 6e 20 | 64 6f 77 6e 2e 20 20 54 | button |down. T|
|00003840| 68 65 6e 20 72 65 6c 65 | 61 73 65 20 74 68 65 20 |hen rele|ase the |
|00003850| 6d 6f 75 73 65 20 62 75 | 74 74 6f 6e 3b 20 74 68 |mouse bu|tton; th|
|00003860| 65 20 72 65 63 74 61 6e | 67 6c 65 0a 73 68 6f 75 |e rectan|gle.shou|
|00003870| 6c 64 20 63 6c 65 61 72 | 2e 20 20 49 66 20 69 74 |ld clear|. If it|
|00003880| 20 64 6f 65 73 6e 27 74 | 20 63 6c 65 61 72 2c 20 | doesn't| clear, |
|00003890| 64 6f 20 69 74 20 61 67 | 61 69 6e 2c 20 62 65 69 |do it ag|ain, bei|
|000038a0| 6e 67 20 63 61 72 65 66 | 75 6c 20 77 68 65 72 65 |ng caref|ul where|
|000038b0| 20 79 6f 75 0a 70 72 65 | 73 73 20 61 6e 64 20 72 | you.pre|ss and r|
|000038c0| 65 6c 65 61 73 65 20 74 | 68 65 20 6d 6f 75 73 65 |elease t|he mouse|
|000038d0| 2e 20 20 4e 6f 77 20 77 | 65 20 61 72 65 20 67 6f |. Now w|e are go|
|000038e0| 69 6e 67 20 74 6f 20 73 | 74 61 72 74 20 65 78 70 |ing to s|tart exp|
|000038f0| 65 72 69 6d 65 6e 74 69 | 6e 67 0a 77 69 74 68 20 |erimenti|ng.with |
|00003900| 75 73 69 6e 67 20 6d 75 | 6c 74 69 70 6c 65 20 44 |using mu|ltiple D|
|00003910| 4d 41 20 63 68 61 6e 6e | 65 6c 73 2e 0a 0a 54 75 |MA chann|els...Tu|
|00003920| 72 6e 20 6f 6e 20 74 68 | 65 20 41 20 44 4d 41 20 |rn on th|e A DMA |
|00003930| 63 68 61 6e 6e 65 6c 2c | 20 61 6e 64 20 73 65 74 |channel,| and set|
|00003940| 20 69 74 73 20 70 6f 69 | 6e 74 65 72 20 74 6f 20 | its poi|nter to |
|00003950| 5c 2e 7b 4d 7d 2e 20 20 | 53 65 74 20 74 68 65 20 |\.{M}. |Set the |
|00003960| 44 0a 63 68 61 6e 6e 65 | 6c 20 70 6f 69 6e 74 65 |D.channe|l pointe|
|00003970| 72 20 74 6f 20 5c 2e 7b | 4d 2b 31 39 32 7d 3b 20 |r to \.{|M+192}; |
|00003980| 74 68 69 73 20 69 73 20 | 74 68 65 20 62 6f 74 74 |this is |the bott|
|00003990| 6f 6d 20 68 61 6c 66 20 | 6f 66 20 74 68 65 20 72 |om half |of the r|
|000039a0| 65 63 74 61 6e 67 6c 65 | 2e 0a 49 66 20 79 6f 75 |ectangle|..If you|
|000039b0| 20 6d 6f 76 65 20 74 68 | 65 20 6d 6f 75 73 65 20 | move th|e mouse |
|000039c0| 74 6f 20 74 68 65 20 6d | 69 64 64 6c 65 20 6f 66 |to the m|iddle of|
|000039d0| 20 74 68 65 20 6c 65 66 | 74 20 65 64 67 65 20 6f | the lef|t edge o|
|000039e0| 66 20 74 68 65 20 72 65 | 63 74 61 6e 67 6c 65 2c |f the re|ctangle,|
|000039f0| 0a 77 69 74 68 69 6e 20 | 74 68 65 20 72 65 63 74 |.within |the rect|
|00003a00| 61 6e 67 6c 65 2c 20 74 | 68 65 20 41 64 72 73 20 |angle, t|he Adrs |
|00003a10| 66 69 65 6c 64 20 73 68 | 6f 75 6c 64 20 64 69 73 |field sh|ould dis|
|00003a20| 70 6c 61 79 20 5c 2e 7b | 4d 2b 31 39 32 7d 3b 20 |play \.{|M+192}; |
|00003a30| 74 68 69 73 20 69 73 0a | 61 6e 20 65 61 73 79 20 |this is.|an easy |
|00003a40| 77 61 79 20 74 6f 20 66 | 69 6e 64 20 74 68 65 20 |way to f|ind the |
|00003a50| 61 64 64 72 65 73 73 20 | 6f 66 20 61 20 70 61 72 |address |of a par|
|00003a60| 74 69 63 75 6c 61 72 20 | 70 6f 72 74 69 6f 6e 20 |ticular |portion |
|00003a70| 6f 66 20 74 68 65 0a 72 | 65 63 74 61 6e 67 6c 65 |of the.r|ectangle|
|00003a80| 2e 20 20 53 65 74 20 74 | 68 65 20 6d 6f 64 75 6c |. Set t|he modul|
|00003a90| 75 73 20 6f 66 20 74 68 | 65 20 44 20 63 68 61 6e |us of th|e D chan|
|00003aa0| 6e 65 6c 20 62 61 63 6b | 20 74 6f 20 5c 2e 7b 30 |nel back| to \.{0|
|00003ab0| 7d 2c 20 73 65 74 20 74 | 68 65 20 57 20 66 69 65 |}, set t|he W fie|
|00003ac0| 6c 64 0a 74 6f 20 5c 2e | 7b 36 7d 2c 20 61 6e 64 |ld.to \.|{6}, and|
|00003ad0| 20 74 68 65 20 48 20 66 | 69 65 6c 64 20 74 6f 20 | the H f|ield to |
|00003ae0| 5c 2e 7b 31 36 7d 2e 20 | 20 53 65 74 20 74 68 65 |\.{16}. | Set the|
|00003af0| 20 60 46 75 6e 63 74 69 | 6f 6e 27 20 74 6f 20 5c | `Functi|on' to \|
|00003b00| 2e 7b 41 7d 2e 20 20 4e | 6f 77 2c 20 64 72 61 77 |.{A}. N|ow, draw|
|00003b10| 0a 73 6f 6d 65 20 72 61 | 6e 64 6f 6d 20 70 69 78 |.some ra|ndom pix|
|00003b20| 65 6c 73 20 69 6e 20 74 | 68 65 20 75 70 70 65 72 |els in t|he upper|
|00003b30| 20 68 61 6c 66 20 6f 66 | 20 74 68 65 20 72 65 63 | half of| the rec|
|00003b40| 74 61 6e 67 6c 65 2e 20 | 20 28 59 6f 75 20 77 69 |tangle. | (You wi|
|00003b50| 6c 6c 20 6e 65 65 64 0a | 74 6f 20 74 6f 67 67 6c |ll need.|to toggl|
|00003b60| 65 20 74 68 65 20 60 42 | 6f 78 27 20 67 61 64 67 |e the `B|ox' gadg|
|00003b70| 65 74 20 74 6f 20 64 6f | 20 74 68 69 73 2e 29 20 |et to do| this.) |
|00003b80| 20 54 68 65 6e 2c 20 68 | 69 74 0a 60 47 4f 27 2e | Then, h|it.`GO'.|
|00003b90| 20 20 54 68 65 20 75 70 | 70 65 72 20 68 61 6c 66 | The up|per half|
|00003ba0| 20 6f 66 20 74 68 65 20 | 72 65 63 74 61 6e 67 6c | of the |rectangl|
|00003bb0| 65 20 73 68 6f 75 6c 64 | 20 62 65 20 64 75 70 6c |e should| be dupl|
|00003bc0| 69 63 61 74 65 64 20 69 | 6e 20 74 68 65 0a 6c 6f |icated i|n the.lo|
|00003bd0| 77 65 72 20 68 61 6c 66 | 21 20 20 54 72 79 20 73 |wer half|! Try s|
|00003be0| 65 74 74 69 6e 67 20 74 | 68 65 20 66 75 6e 63 74 |etting t|he funct|
|00003bf0| 69 6f 6e 20 74 6f 20 5c | 2e 7b 7e 41 7d 2c 20 61 |ion to \|.{~A}, a|
|00003c00| 6e 64 20 73 65 65 20 77 | 68 61 74 20 68 61 70 70 |nd see w|hat happ|
|00003c10| 65 6e 73 2e 0a 59 6f 75 | 20 61 72 65 20 61 63 74 |ens..You| are act|
|00003c20| 75 61 6c 6c 79 20 63 6f | 70 79 69 6e 67 20 6d 65 |ually co|pying me|
|00003c30| 6d 6f 72 79 21 0a 0a 5c | 73 65 63 74 69 6f 6e 20 |mory!..\|section |
|00003c40| 53 65 74 74 69 6e 67 20 | 4d 65 6d 6f 72 79 20 74 |Setting |Memory t|
|00003c50| 6f 20 61 20 50 61 72 74 | 69 63 75 6c 61 72 20 56 |o a Part|icular V|
|00003c60| 61 6c 75 65 5c 5c 0a 0a | 59 6f 75 20 63 61 6e 20 |alue\\..|You can |
|00003c70| 61 6c 73 6f 20 73 65 74 | 20 6d 65 6d 6f 72 79 20 |also set| memory |
|00003c80| 74 6f 20 61 20 70 61 72 | 74 69 63 75 6c 61 72 20 |to a par|ticular |
|00003c90| 76 61 6c 75 65 2e 0a 54 | 75 72 6e 20 6f 66 66 20 |value..T|urn off |
|00003ca0| 74 68 65 20 41 20 44 4d | 41 20 63 68 61 6e 6e 65 |the A DM|A channe|
|00003cb0| 6c 2c 20 62 75 74 20 6c | 65 61 76 65 20 74 68 65 |l, but l|eave the|
|00003cc0| 0a 66 75 6e 63 74 69 6f | 6e 20 73 65 74 20 74 6f |.functio|n set to|
|00003cd0| 20 5c 2e 7b 41 7d 2e 20 | 20 4e 6f 77 20 70 75 74 | \.{A}. | Now put|
|00003ce0| 20 74 68 65 20 76 61 6c | 75 65 20 5c 2e 7b 5c 24 | the val|ue \.{\$|
|00003cf0| 35 35 35 35 7d 20 69 6e | 20 74 68 65 20 41 44 41 |5555} in| the ADA|
|00003d00| 54 20 67 61 64 67 65 74 | 20 28 74 79 70 65 0a 74 |T gadget| (type.t|
|00003d10| 68 65 20 64 6f 6c 6c 61 | 72 20 73 69 67 6e 2c 20 |he dolla|r sign, |
|00003d20| 70 6c 65 61 73 65 2e 29 | 20 20 48 69 74 20 60 47 |please.)| Hit `G|
|00003d30| 4f 27 2e 20 20 59 6f 75 | 20 73 68 6f 75 6c 64 20 |O'. You| should |
|00003d40| 67 65 74 20 73 74 72 69 | 70 65 73 20 69 6e 20 74 |get stri|pes in t|
|00003d50| 68 65 0a 6c 6f 77 65 72 | 20 70 6f 72 74 69 6f 6e |he.lower| portion|
|00003d60| 20 6f 66 20 74 68 65 20 | 72 65 63 74 61 6e 67 6c | of the |rectangl|
|00003d70| 65 2e 20 20 57 68 61 74 | 20 69 73 20 68 61 70 70 |e. What| is happ|
|00003d80| 65 6e 69 6e 67 20 68 65 | 72 65 20 69 73 20 74 68 |ening he|re is th|
|00003d90| 61 74 20 74 68 65 0a 41 | 20 44 4d 41 20 63 68 61 |at the.A| DMA cha|
|00003da0| 6e 6e 65 6c 20 69 73 20 | 74 75 72 6e 65 64 20 6f |nnel is |turned o|
|00003db0| 66 66 2c 20 73 6f 20 6e | 6f 20 6d 65 6d 6f 72 79 |ff, so n|o memory|
|00003dc0| 20 69 73 20 62 65 69 6e | 67 20 6c 6f 61 64 65 64 | is bein|g loaded|
|00003dd0| 20 69 6e 74 6f 20 74 68 | 65 20 41 0a 63 68 61 6e | into th|e A.chan|
|00003de0| 6e 65 6c 2e 20 20 49 6e | 73 74 65 61 64 2c 20 74 |nel. In|stead, t|
|00003df0| 68 65 20 76 61 6c 75 65 | 20 69 6e 20 74 68 65 20 |he value| in the |
|00003e00| 41 20 64 61 74 61 20 72 | 65 67 69 73 74 65 72 20 |A data r|egister |
|00003e10| 69 73 20 62 65 69 6e 67 | 20 75 73 65 64 2e 0a 54 |is being| used..T|
|00003e20| 68 69 73 20 69 73 20 61 | 20 71 75 69 63 6b 20 77 |his is a| quick w|
|00003e30| 61 79 20 74 6f 20 73 65 | 74 20 61 20 6d 65 6d 6f |ay to se|t a memo|
|00003e40| 72 79 20 72 65 67 69 6f | 6e 20 74 6f 20 61 20 70 |ry regio|n to a p|
|00003e50| 61 72 74 69 63 75 6c 61 | 72 20 76 61 6c 75 65 2e |articula|r value.|
|00003e60| 0a 54 68 65 20 69 6d 70 | 6f 72 74 61 6e 74 20 70 |.The imp|ortant p|
|00003e70| 6f 69 6e 74 20 74 6f 20 | 72 65 6d 65 6d 62 65 72 |oint to |remember|
|00003e80| 20 68 65 72 65 20 69 73 | 20 74 68 61 74 20 79 6f | here is| that yo|
|00003e90| 75 20 63 61 6e 20 75 73 | 65 20 61 0a 63 68 61 6e |u can us|e a.chan|
|00003ea0| 6e 65 6c 20 61 73 20 61 | 20 63 6f 6e 73 74 61 6e |nel as a| constan|
|00003eb0| 74 20 69 66 20 79 6f 75 | 20 74 75 72 6e 20 69 74 |t if you| turn it|
|00003ec0| 20 6f 66 66 20 61 6e 64 | 20 70 72 65 6c 6f 61 64 | off and| preload|
|00003ed0| 20 69 74 73 20 64 61 74 | 61 20 72 65 67 69 73 74 | its dat|a regist|
|00003ee0| 65 72 2e 0a 0a 5c 73 65 | 63 74 69 6f 6e 20 4d 6f |er...\se|ction Mo|
|00003ef0| 72 65 20 43 6f 6d 70 6c | 65 78 20 4f 70 65 72 61 |re Compl|ex Opera|
|00003f00| 74 69 6f 6e 73 5c 5c 0a | 0a 4c 65 74 27 73 20 74 |tions\\.|.Let's t|
|00003f10| 72 79 20 73 6f 6d 65 20 | 6d 6f 72 65 20 63 6f 6d |ry some |more com|
|00003f20| 70 6c 65 78 20 6f 70 65 | 72 61 74 69 6f 6e 73 20 |plex ope|rations |
|00003f30| 6f 6e 20 6d 65 6d 6f 72 | 79 2c 20 6e 6f 77 2e 20 |on memor|y, now. |
|00003f40| 20 57 65 20 61 72 65 20 | 67 6f 69 6e 67 0a 74 6f | We are |going.to|
|00003f50| 20 64 69 76 69 64 65 20 | 6f 75 72 20 72 65 63 74 | divide |our rect|
|00003f60| 61 6e 67 75 6c 61 72 20 | 72 65 67 69 6f 6e 20 69 |angular |region i|
|00003f70| 6e 74 6f 20 66 6f 75 72 | 20 61 72 65 61 73 2c 20 |nto four| areas, |
|00003f80| 6f 6e 65 20 66 6f 72 20 | 41 2c 20 6f 6e 65 20 66 |one for |A, one f|
|00003f90| 6f 72 0a 42 2c 20 6f 6e | 65 20 66 6f 72 20 43 2c |or.B, on|e for C,|
|00003fa0| 20 61 6e 64 20 6f 6e 65 | 20 66 6f 72 20 44 2e 20 | and one| for D. |
|00003fb0| 20 53 65 74 20 57 20 74 | 6f 20 5c 2e 7b 33 7d 2c | Set W t|o \.{3},|
|00003fc0| 20 61 6c 6c 20 66 6f 75 | 72 20 6d 6f 64 75 6c 75 | all fou|r modulu|
|00003fd0| 73 20 76 61 6c 75 65 73 | 20 74 6f 0a 5c 2e 7b 36 |s values| to.\.{6|
|00003fe0| 7d 2c 20 61 6e 64 20 74 | 68 65 20 50 54 20 67 61 |}, and t|he PT ga|
|00003ff0| 64 67 65 74 73 20 66 6f | 72 20 41 2c 20 42 2c 20 |dgets fo|r A, B, |
|00004000| 43 2c 20 61 6e 64 20 44 | 20 74 6f 20 5c 2e 7b 4d |C, and D| to \.{M|
|00004010| 7d 2c 20 5c 2e 7b 4d 2b | 36 7d 2c 20 5c 2e 7b 4d |}, \.{M+|6}, \.{M|
|00004020| 2b 31 39 32 7d 2c 0a 61 | 6e 64 20 5c 2e 7b 4d 2b |+192},.a|nd \.{M+|
|00004030| 31 39 38 7d 2c 0a 72 65 | 73 70 65 63 74 69 76 65 |198},.re|spective|
|00004040| 6c 79 2e 20 20 4e 6f 77 | 20 64 72 61 77 20 73 6f |ly. Now| draw so|
|00004050| 6d 65 20 72 61 6e 64 6f | 6d 20 74 68 69 6e 67 73 |me rando|m things|
|00004060| 20 69 6e 20 74 68 65 20 | 72 65 67 69 6f 6e 73 20 | in the |regions |
|00004070| 63 6f 72 72 65 73 70 6f | 6e 64 69 6e 67 0a 74 6f |correspo|nding.to|
|00004080| 20 41 2c 20 42 2c 20 61 | 6e 64 20 43 2e 20 20 49 | A, B, a|nd C. I|
|00004090| 20 72 65 63 6f 6d 6d 65 | 6e 64 2c 20 66 6f 72 20 | recomme|nd, for |
|000040a0| 69 6e 73 74 61 6e 63 65 | 2c 20 66 69 6c 6c 69 6e |instance|, fillin|
|000040b0| 67 20 74 68 65 20 6c 65 | 66 74 20 68 61 6c 66 20 |g the le|ft half |
|000040c0| 6f 66 0a 41 2c 20 74 68 | 65 20 74 6f 70 20 68 61 |of.A, th|e top ha|
|000040d0| 6c 66 20 6f 66 20 42 2c | 20 61 6e 64 20 61 20 73 |lf of B,| and a s|
|000040e0| 6d 61 6c 6c 65 72 20 72 | 65 63 74 61 6e 67 6c 65 |maller r|ectangle|
|000040f0| 20 69 6e 20 74 68 65 20 | 6d 69 64 64 6c 65 20 6f | in the |middle o|
|00004100| 66 20 43 2e 0a 59 6f 75 | 20 73 68 6f 75 6c 64 20 |f C..You| should |
|00004110| 75 73 65 20 74 68 65 20 | 60 42 6f 78 27 20 64 72 |use the |`Box' dr|
|00004120| 61 77 69 6e 67 20 6d 6f | 64 65 2e 20 20 54 75 72 |awing mo|de. Tur|
|00004130| 6e 20 61 6c 6c 20 66 6f | 75 72 20 44 4d 41 0a 63 |n all fo|ur DMA.c|
|00004140| 68 61 6e 6e 65 6c 73 20 | 6f 6e 2c 20 61 6e 64 20 |hannels |on, and |
|00004150| 73 65 74 20 74 68 65 20 | 66 75 6e 63 74 69 6f 6e |set the |function|
|00004160| 20 74 6f 20 0a 5c 2e 7b | 41 42 43 2b 41 7e 41 7e | to .\.{|ABC+A~A~|
|00004170| 42 2b 7e 41 42 7e 43 2b | 7e 41 7e 42 43 7d 2e 20 |B+~AB~C+|~A~BC}. |
|00004180| 20 45 78 65 63 75 74 65 | 20 60 47 4f 27 3b 20 74 | Execute| `GO'; t|
|00004190| 68 65 72 65 0a 73 68 6f | 75 6c 64 20 62 65 20 65 |here.sho|uld be e|
|000041a0| 69 67 68 74 20 64 69 73 | 74 69 6e 63 74 20 72 65 |ight dis|tinct re|
|000041b0| 67 69 6f 6e 73 2e 20 20 | 28 54 68 65 20 66 75 6e |gions. |(The fun|
|000041c0| 63 74 69 6f 6e 20 69 73 | 20 65 71 75 69 76 61 6c |ction is| equival|
|000041d0| 65 6e 74 20 74 6f 0a 41 | 5c 78 6f 72 20 42 5c 78 |ent to.A|\xor B\x|
|000041e0| 6f 72 20 43 29 2e 0a 0a | 4e 6f 77 20 79 6f 75 20 |or C)...|Now you |
|000041f0| 63 61 6e 20 65 78 70 65 | 72 69 6d 65 6e 74 20 77 |can expe|riment w|
|00004200| 69 74 68 20 74 68 65 20 | 76 61 72 69 6f 75 73 20 |ith the |various |
|00004210| 70 6f 73 73 69 62 6c 65 | 20 66 75 6e 63 74 69 6f |possible| functio|
|00004220| 6e 73 2e 20 20 54 72 79 | 20 74 68 65 0a 66 75 6e |ns. Try| the.fun|
|00004230| 63 74 69 6f 6e 20 5c 2e | 7b 41 42 7d 3b 20 69 73 |ction \.|{AB}; is|
|00004240| 20 74 68 65 20 72 65 73 | 75 6c 74 20 6f 6e 6c 79 | the res|ult only|
|00004250| 20 74 68 6f 73 65 20 62 | 69 74 73 20 74 68 61 74 | those b|its that|
|00004260| 20 68 61 76 65 20 62 6f | 74 68 20 41 20 61 6e 64 | have bo|th A and|
|00004270| 20 42 20 73 65 74 3f 0a | 4e 6f 77 20 74 72 79 20 | B set?.|Now try |
|00004280| 5c 2e 7b 41 2b 42 7d 2c | 20 74 68 69 73 20 74 69 |\.{A+B},| this ti|
|00004290| 6d 65 20 65 69 74 68 65 | 72 20 41 20 6f 72 20 42 |me eithe|r A or B|
|000042a0| 20 73 65 74 20 73 68 6f | 75 6c 64 20 72 65 73 75 | set sho|uld resu|
|000042b0| 6c 74 20 69 6e 20 61 20 | 64 65 73 74 69 6e 61 74 |lt in a |destinat|
|000042c0| 69 6f 6e 0a 62 69 74 20 | 6f 6e 2e 20 20 41 6e 64 |ion.bit |on. And|
|000042d0| 20 73 6f 20 6f 6e 20 61 | 6e 64 20 73 6f 20 66 6f | so on a|nd so fo|
|000042e0| 72 74 68 2e 0a 0a 53 6f | 20 68 6f 77 20 61 72 65 |rth...So| how are|
|000042f0| 20 74 68 65 73 65 20 66 | 75 6e 63 74 69 6f 6e 20 | these f|unction |
|00004300| 63 6f 64 65 73 20 63 6f | 6d 70 75 74 65 64 3f 20 |codes co|mputed? |
|00004310| 20 41 63 74 75 61 6c 6c | 79 2c 20 69 74 20 69 73 | Actuall|y, it is|
|00004320| 20 71 75 69 74 65 20 73 | 69 6d 70 6c 65 2e 0a 41 | quite s|imple..A|
|00004330| 73 20 79 6f 75 20 65 6e | 74 65 72 20 61 20 6e 65 |s you en|ter a ne|
|00004340| 77 20 66 75 6e 63 74 69 | 6f 6e 2c 20 6e 6f 74 65 |w functi|on, note|
|00004350| 20 68 6f 77 20 74 68 65 | 20 6c 65 61 73 74 20 73 | how the| least s|
|00004360| 69 67 6e 69 66 69 63 61 | 6e 74 20 66 6f 75 72 20 |ignifica|nt four |
|00004370| 6e 79 62 62 6c 65 73 0a | 6f 66 20 43 4f 4e 30 20 |nybbles.|of CON0 |
|00004380| 28 6c 6f 77 65 72 20 6c | 65 66 74 20 62 6f 78 20 |(lower l|eft box |
|00004390| 6f 6e 20 74 68 65 20 64 | 69 73 70 6c 61 79 29 20 |on the d|isplay) |
|000043a0| 63 68 61 6e 67 65 3b 20 | 74 68 69 73 20 69 73 20 |change; |this is |
|000043b0| 74 68 65 20 68 65 78 61 | 64 65 63 69 6d 61 6c 0a |the hexa|decimal.|
|000043c0| 72 65 70 72 65 73 65 6e | 74 61 74 69 6f 6e 20 6f |represen|tation o|
|000043d0| 66 20 74 68 65 20 65 71 | 75 61 74 69 6f 6e 20 79 |f the eq|uation y|
|000043e0| 6f 75 20 65 6e 74 65 72 | 65 64 2e 20 20 59 6f 75 |ou enter|ed. You|
|000043f0| 20 6d 75 73 74 20 77 72 | 69 74 65 20 79 6f 75 72 | must wr|ite your|
|00004400| 20 66 75 6e 63 74 69 6f | 6e 0a 61 73 20 61 20 73 | functio|n.as a s|
|00004410| 75 6d 20 6f 66 20 70 72 | 6f 64 75 63 74 73 3b 20 |um of pr|oducts; |
|00004420| 74 68 65 20 70 72 6f 64 | 75 63 74 73 20 68 61 76 |the prod|ucts hav|
|00004430| 65 20 74 68 65 20 76 61 | 6c 75 65 73 3a 0a 0a 24 |e the va|lues:..$|
|00004440| 24 5c 76 62 6f 78 7b 5c | 63 61 74 63 6f 64 65 60 |$\vbox{\|catcode`|
|00004450| 5c 7e 3d 5c 61 63 74 69 | 76 65 5c 61 63 74 69 76 |\~=\acti|ve\activ|
|00004460| 65 5c 6c 65 74 7e 3d 5c | 6e 6f 74 0a 5c 68 61 6c |e\let~=\|not.\hal|
|00004470| 69 67 6e 7b 5c 68 66 69 | 6c 23 5c 71 75 61 64 26 |ign{\hfi|l#\quad&|
|00004480| 7b 5c 74 74 20 23 7d 5c | 71 71 75 61 64 26 5c 68 |{\tt #}\|qquad&\h|
|00004490| 66 69 6c 23 5c 71 75 61 | 64 26 7b 5c 74 74 20 23 |fil#\qua|d&{\tt #|
|000044a0| 7d 5c 71 71 75 61 64 26 | 0a 5c 68 66 69 6c 23 5c |}\qquad&|.\hfil#\|
|000044b0| 71 75 61 64 26 7b 5c 74 | 74 20 23 7d 5c 63 72 0a |quad&{\t|t #}\cr.|
|000044c0| 41 26 46 30 26 42 26 43 | 43 26 43 26 41 41 5c 63 |A&F0&B&C|C&C&AA\c|
|000044d0| 72 0a 7e 41 26 30 46 26 | 7e 42 26 33 33 26 7e 43 |r.~A&0F&|~B&33&~C|
|000044e0| 26 35 35 5c 63 72 0a 41 | 42 26 43 30 26 41 43 26 |&55\cr.A|B&C0&AC&|
|000044f0| 41 30 26 42 43 26 38 38 | 5c 63 72 0a 41 7e 42 26 |A0&BC&88|\cr.A~B&|
|00004500| 33 30 26 41 7e 43 26 35 | 30 26 42 7e 43 26 34 34 |30&A~C&5|0&B~C&44|
|00004510| 5c 63 72 0a 7e 41 42 26 | 30 43 26 7e 41 43 26 30 |\cr.~AB&|0C&~AC&0|
|00004520| 41 26 7e 42 43 26 32 32 | 5c 63 72 0a 7e 41 7e 42 |A&~BC&22|\cr.~A~B|
|00004530| 26 30 33 26 7e 41 7e 43 | 26 30 35 26 7e 42 7e 43 |&03&~A~C|&05&~B~C|
|00004540| 26 31 31 5c 63 72 0a 41 | 42 7e 43 26 34 30 26 41 |&11\cr.A|B~C&40&A|
|00004550| 7e 42 43 26 32 30 26 7e | 41 42 43 26 30 38 5c 63 |~BC&20&~|ABC&08\c|
|00004560| 72 0a 41 7e 42 7e 43 26 | 31 30 26 7e 41 42 7e 43 |r.A~B~C&|10&~AB~C|
|00004570| 26 30 34 26 7e 41 7e 42 | 43 26 30 32 5c 63 72 0a |&04&~A~B|C&02\cr.|
|00004580| 41 42 43 26 38 30 26 7e | 41 7e 42 7e 43 26 30 31 |ABC&80&~|A~B~C&01|
|00004590| 5c 63 72 7d 7d 24 24 0a | 0a 54 6f 20 73 75 6d 20 |\cr}}$$.|.To sum |
|000045a0| 74 68 65 6d 2c 20 73 69 | 6d 70 6c 79 20 60 6f 72 |them, si|mply `or|
|000045b0| 27 20 74 68 65 6d 2e 20 | 20 28 44 6f 20 6e 6f 74 |' them. | (Do not|
|000045c0| 20 61 64 64 20 74 68 65 | 6d 2e 29 20 20 54 68 75 | add the|m.) Thu|
|000045d0| 73 2c 20 41 5c 78 6f 72 | 20 42 20 69 73 0a 41 5c |s, A\xor| B is.A\|
|000045e0| 6e 6f 74 20 42 2b 5c 6e | 6f 74 20 41 42 20 6f 72 |not B+\n|ot AB or|
|000045f0| 20 7b 5c 74 74 20 33 30 | 7d 24 5c 76 65 65 24 7b | {\tt 30|}$\vee${|
|00004600| 5c 74 74 20 30 43 7d 20 | 6f 72 20 7b 5c 74 74 20 |\tt 0C} |or {\tt |
|00004610| 33 43 7d 2e 20 20 49 74 | 20 69 73 20 75 73 75 61 |3C}. It| is usua|
|00004620| 6c 6c 79 20 65 61 73 69 | 65 72 0a 6a 75 73 74 20 |lly easi|er.just |
|00004630| 74 6f 20 65 6e 74 65 72 | 20 74 68 65 20 65 71 75 |to enter| the equ|
|00004640| 61 74 69 6f 6e 20 69 6e | 74 6f 20 42 6c 69 74 4c |ation in|to BlitL|
|00004650| 61 62 20 61 6e 64 20 72 | 65 61 64 20 74 68 65 20 |ab and r|ead the |
|00004660| 72 65 73 75 6c 74 2c 20 | 68 6f 77 65 76 65 72 2e |result, |however.|
|00004670| 0a 0a 5c 73 65 63 74 69 | 6f 6e 20 53 68 69 66 74 |..\secti|on Shift|
|00004680| 73 20 61 6e 64 20 4d 61 | 73 6b 73 5c 5c 0a 0a 41 |s and Ma|sks\\..A|
|00004690| 66 74 65 72 20 79 6f 75 | 20 68 61 76 65 20 68 61 |fter you| have ha|
|000046a0| 64 20 79 6f 75 72 20 66 | 69 6c 6c 20 6f 66 20 65 |d your f|ill of e|
|000046b0| 78 70 65 72 69 6d 65 6e | 74 69 6e 67 20 77 69 74 |xperimen|ting wit|
|000046c0| 68 20 74 68 65 20 6c 6f | 67 69 63 20 65 71 75 61 |h the lo|gic equa|
|000046d0| 74 69 6f 6e 73 2c 20 77 | 65 0a 63 61 6e 20 70 72 |tions, w|e.can pr|
|000046e0| 6f 63 65 65 64 20 74 6f | 20 73 68 69 66 74 73 20 |oceed to| shifts |
|000046f0| 61 6e 64 20 6d 61 73 6b | 73 2e 20 20 42 6f 74 68 |and mask|s. Both|
|00004700| 20 74 68 65 20 41 20 61 | 6e 64 20 42 20 44 4d 41 | the A a|nd B DMA|
|00004710| 20 63 68 61 6e 6e 65 6c | 20 68 61 76 65 0a 69 6e | channel| have.in|
|00004720| 64 65 70 65 6e 64 65 6e | 74 20 73 68 69 66 74 73 |dependen|t shifts|
|00004730| 2e 20 20 49 6e 20 61 64 | 64 69 74 69 6f 6e 2c 20 |. In ad|dition, |
|00004740| 74 68 65 20 41 20 63 68 | 61 6e 6e 65 6c 20 68 61 |the A ch|annel ha|
|00004750| 73 20 61 20 66 69 72 73 | 74 20 77 6f 72 64 20 61 |s a firs|t word a|
|00004760| 6e 64 20 6c 61 73 74 0a | 77 6f 72 64 20 6d 61 73 |nd last.|word mas|
|00004770| 6b 2e 20 20 54 68 65 73 | 65 20 61 72 65 20 65 73 |k. Thes|e are es|
|00004780| 73 65 6e 74 69 61 6c 20 | 69 6e 20 6d 61 6b 69 6e |sential |in makin|
|00004790| 67 20 6f 75 72 20 77 6f | 72 64 20 62 6c 69 74 74 |g our wo|rd blitt|
|000047a0| 65 72 20 61 70 70 65 61 | 72 20 74 6f 0a 62 65 20 |er appea|r to.be |
|000047b0| 61 6e 20 61 63 74 75 61 | 6c 20 62 69 74 20 62 6c |an actua|l bit bl|
|000047c0| 69 74 74 65 72 2e 20 20 | 46 69 72 73 74 2c 20 75 |itter. |First, u|
|000047d0| 73 69 6e 67 20 74 68 65 | 20 73 61 6d 65 20 73 65 |sing the| same se|
|000047e0| 74 2d 75 70 20 79 6f 75 | 20 68 61 64 20 66 6f 72 |t-up you| had for|
|000047f0| 20 74 68 65 0a 70 72 65 | 76 69 6f 75 73 20 65 78 | the.pre|vious ex|
|00004800| 70 65 72 69 6d 65 6e 74 | 2c 20 73 65 74 20 74 68 |periment|, set th|
|00004810| 65 20 41 20 73 68 69 66 | 74 20 74 6f 20 5c 2e 7b |e A shif|t to \.{|
|00004820| 33 7d 2e 20 20 28 54 68 | 65 20 6c 65 66 74 20 68 |3}. (Th|e left h|
|00004830| 61 6c 66 20 6f 66 20 74 | 68 65 20 41 0a 72 65 67 |alf of t|he A.reg|
|00004840| 69 6f 6e 2c 20 74 6f 70 | 20 68 61 6c 66 20 6f 66 |ion, top| half of|
|00004850| 20 74 68 65 20 42 20 72 | 65 67 69 6f 6e 2c 20 61 | the B r|egion, a|
|00004860| 6e 64 20 61 20 6d 69 64 | 64 6c 65 20 73 65 63 74 |nd a mid|dle sect|
|00004870| 69 6f 6e 20 6f 66 20 74 | 68 65 20 43 20 72 65 67 |ion of t|he C reg|
|00004880| 69 6f 6e 0a 73 68 6f 75 | 6c 64 20 62 65 20 73 65 |ion.shou|ld be se|
|00004890| 74 20 61 74 20 74 68 69 | 73 20 70 6f 69 6e 74 2e |t at thi|s point.|
|000048a0| 29 20 20 53 68 69 66 74 | 73 20 76 61 6c 75 65 73 |) Shift|s values|
|000048b0| 20 61 72 65 20 61 6c 77 | 61 79 73 20 74 6f 20 74 | are alw|ays to t|
|000048c0| 68 65 0a 72 69 67 68 74 | 2e 20 20 53 65 74 20 74 |he.right|. Set t|
|000048d0| 68 65 20 66 75 6e 63 74 | 69 6f 6e 20 74 6f 20 6f |he funct|ion to o|
|000048e0| 75 72 20 67 6f 6f 64 20 | 6f 6c 64 20 5c 2e 7b 41 |ur good |old \.{A|
|000048f0| 42 43 2b 41 7e 42 7e 43 | 2b 7e 41 42 7e 43 2b 7e |BC+A~B~C|+~AB~C+~|
|00004900| 41 7e 42 43 7d 2c 20 61 | 6e 64 20 60 47 4f 27 2e |A~BC}, a|nd `GO'.|
|00004910| 0a 59 6f 75 20 73 68 6f | 75 6c 64 20 6e 6f 74 69 |.You sho|uld noti|
|00004920| 63 65 20 74 68 65 20 73 | 68 69 66 74 20 6f 66 20 |ce the s|hift of |
|00004930| 74 68 65 20 41 20 6f 70 | 65 72 61 6e 64 2c 20 61 |the A op|erand, a|
|00004940| 6e 64 20 61 6c 73 6f 20 | 6e 6f 74 69 63 65 20 74 |nd also |notice t|
|00004950| 68 61 74 20 7a 65 72 6f | 73 0a 61 72 65 20 73 68 |hat zero|s.are sh|
|00004960| 69 66 74 65 64 20 69 6e | 20 66 72 6f 6d 20 74 68 |ifted in| from th|
|00004970| 65 20 6c 65 66 74 2e 20 | 20 4e 6f 77 20 72 65 73 |e left. | Now res|
|00004980| 65 74 20 74 68 65 20 41 | 20 73 68 69 66 74 20 74 |et the A| shift t|
|00004990| 6f 20 5c 2e 7b 30 7d 2c | 20 61 6e 64 20 73 65 74 |o \.{0},| and set|
|000049a0| 20 74 68 65 0a 42 20 73 | 68 69 66 74 20 74 6f 20 | the.B s|hift to |
|000049b0| 5c 2e 7b 33 7d 2e 20 20 | 59 6f 75 20 73 68 6f 75 |\.{3}. |You shou|
|000049c0| 6c 64 20 67 65 74 20 73 | 6f 6d 65 20 73 74 72 61 |ld get s|ome stra|
|000049d0| 6e 67 65 20 72 65 73 75 | 6c 74 73 3b 20 74 68 65 |nge resu|lts; the|
|000049e0| 72 65 20 61 72 65 20 61 | 20 66 65 77 20 70 69 78 |re are a| few pix|
|000049f0| 65 6c 73 0a 74 68 61 74 | 20 73 68 6f 75 6c 64 20 |els.that| should |
|00004a00| 62 65 20 73 65 74 2c 20 | 62 75 74 20 61 72 65 6e |be set, |but aren|
|00004a10| 27 74 2c 20 61 6e 64 20 | 61 20 66 65 77 20 73 65 |'t, and |a few se|
|00004a20| 74 20 74 68 61 74 20 73 | 68 6f 75 6c 64 20 62 65 |t that s|hould be|
|00004a30| 20 63 6c 65 61 72 2e 0a | 59 65 73 2c 20 79 6f 75 | clear..|Yes, you|
|00004a40| 72 20 41 6d 69 67 61 20 | 69 73 0a 77 6f 72 6b 69 |r Amiga |is.worki|
|00004a50| 6e 67 2e 20 20 4c 65 74 | 27 73 20 65 78 61 6d 69 |ng. Let|'s exami|
|00004a60| 6e 65 20 65 78 61 63 74 | 6c 79 20 77 68 61 74 27 |ne exact|ly what'|
|00004a70| 73 20 68 61 70 70 65 6e | 69 6e 67 20 68 65 72 65 |s happen|ing here|
|00004a80| 2e 20 20 28 57 65 20 61 | 72 65 20 61 6c 73 6f 20 |. (We a|re also |
|00004a90| 67 6f 69 6e 67 0a 74 6f | 20 75 70 64 61 74 65 20 |going.to| update |
|00004aa0| 6f 75 72 20 62 6c 69 74 | 74 65 72 20 61 6c 67 6f |our blit|ter algo|
|00004ab0| 72 69 74 68 6d 2e 29 0a | 0a 54 6f 20 69 6c 6c 75 |rithm.).|.To illu|
|00004ac0| 73 74 72 61 74 65 20 74 | 68 65 20 60 70 72 6f 62 |strate t|he `prob|
|00004ad0| 6c 65 6d 27 20 62 65 73 | 74 2c 20 66 69 6c 6c 20 |lem' bes|t, fill |
|00004ae0| 74 68 65 20 74 6f 70 20 | 68 61 6c 66 20 6f 66 20 |the top |half of |
|00004af0| 74 68 65 20 41 20 72 65 | 67 69 6f 6e 2c 20 61 6e |the A re|gion, an|
|00004b00| 64 0a 63 6c 65 61 72 20 | 74 68 65 20 62 6f 74 74 |d.clear |the bott|
|00004b10| 6f 6d 20 68 61 6c 66 2e | 20 20 53 65 74 20 74 68 |om half.| Set th|
|00004b20| 65 20 66 75 6e 63 74 69 | 6f 6e 20 65 71 75 61 6c |e functi|on equal|
|00004b30| 20 74 6f 20 60 41 27 2c | 20 61 6e 64 20 73 65 74 | to `A',| and set|
|00004b40| 20 74 68 65 20 41 20 73 | 68 69 66 74 0a 74 6f 20 | the A s|hift.to |
|00004b50| 33 2e 20 20 48 69 74 20 | 60 47 4f 27 2c 20 61 6e |3. Hit |`GO', an|
|00004b60| 64 20 6c 65 74 20 6d 65 | 20 65 78 70 6c 61 69 6e |d let me| explain|
|00004b70| 20 77 68 61 74 20 79 6f | 75 20 68 61 76 65 20 6f | what yo|u have o|
|00004b80| 6e 20 79 6f 75 72 20 73 | 63 72 65 65 6e 2e 0a 54 |n your s|creen..T|
|00004b90| 68 65 20 64 65 73 74 69 | 6e 61 74 69 6f 6e 20 6c |he desti|nation l|
|00004ba0| 6f 6f 6b 73 20 65 78 61 | 63 74 6c 79 20 6c 69 6b |ooks exa|ctly lik|
|00004bb0| 65 20 74 68 65 20 73 6f | 75 72 63 65 2c 20 65 78 |e the so|urce, ex|
|00004bc0| 63 65 70 74 20 74 68 65 | 20 66 69 72 73 74 20 74 |cept the| first t|
|00004bd0| 68 72 65 65 20 70 69 78 | 65 6c 73 0a 69 6e 20 74 |hree pix|els.in t|
|00004be0| 68 65 20 74 6f 70 20 72 | 6f 77 20 61 72 65 20 63 |he top r|ow are c|
|00004bf0| 6c 65 61 72 2c 20 61 6e | 64 20 74 68 65 20 66 69 |lear, an|d the fi|
|00004c00| 72 73 74 20 74 68 72 65 | 65 20 70 69 78 65 6c 73 |rst thre|e pixels|
|00004c10| 20 69 6e 20 74 68 65 20 | 66 69 72 73 74 20 72 6f | in the |first ro|
|00004c20| 77 0a 77 68 69 63 68 20 | 69 73 20 73 75 70 70 6f |w.which |is suppo|
|00004c30| 73 65 64 20 74 6f 20 62 | 65 20 74 6f 74 61 6c 6c |sed to b|e totall|
|00004c40| 79 20 63 6c 65 61 72 20 | 61 72 65 20 73 65 74 21 |y clear |are set!|
|00004c50| 20 20 54 68 69 73 20 69 | 73 20 62 65 63 61 75 73 | This i|s becaus|
|00004c60| 65 20 6f 66 20 74 68 65 | 20 77 61 79 0a 74 68 65 |e of the| way.the|
|00004c70| 20 62 6c 69 74 74 65 72 | 20 73 68 69 66 74 73 2e | blitter| shifts.|
|00004c80| 0a 0a 54 68 65 72 65 20 | 69 73 20 61 6e 20 69 6e |..There |is an in|
|00004c90| 74 65 72 6e 61 6c 20 72 | 65 67 69 73 74 65 72 20 |ternal r|egister |
|00004ca0| 77 68 69 63 68 20 68 6f | 6c 64 73 20 62 69 74 73 |which ho|lds bits|
|00004cb0| 20 62 65 74 77 65 65 6e | 20 64 61 74 61 20 66 65 | between| data fe|
|00004cc0| 74 63 68 65 73 20 66 6f | 72 0a 74 68 65 20 41 20 |tches fo|r.the A |
|00004cd0| 61 6e 64 20 42 20 72 65 | 67 69 73 74 65 72 73 2e |and B re|gisters.|
|00004ce0| 20 20 54 68 69 73 20 72 | 65 67 69 73 74 65 72 20 | This r|egister |
|00004cf0| 69 73 20 69 6e 69 74 69 | 61 6c 69 7a 65 64 20 74 |is initi|alized t|
|00004d00| 6f 20 61 6c 6c 20 7a 65 | 72 6f 73 20 61 74 20 74 |o all ze|ros at t|
|00004d10| 68 65 0a 62 65 67 69 6e | 6e 69 6e 67 20 6f 66 20 |he.begin|ning of |
|00004d20| 61 20 62 6c 69 74 20 28 | 69 74 20 69 73 20 6e 6f |a blit (|it is no|
|00004d30| 74 20 74 68 65 20 44 61 | 74 61 20 72 65 67 69 73 |t the Da|ta regis|
|00004d40| 74 65 72 2c 20 77 68 69 | 63 68 20 69 73 20 69 67 |ter, whi|ch is ig|
|00004d50| 6e 6f 72 65 64 20 6f 6e | 0a 61 6c 6c 20 62 6c 69 |nored on|.all bli|
|00004d60| 74 73 20 77 69 74 68 20 | 74 68 61 74 20 70 61 72 |ts with |that par|
|00004d70| 74 69 63 75 6c 61 72 20 | 44 4d 41 20 63 68 61 6e |ticular |DMA chan|
|00004d80| 6e 65 6c 20 74 75 72 6e | 65 64 20 6f 6e 2e 29 20 |nel turn|ed on.) |
|00004d90| 20 41 73 20 61 20 77 6f | 72 64 20 69 73 20 66 65 | As a wo|rd is fe|
|00004da0| 74 63 68 65 64 2c 0a 69 | 74 20 69 73 20 73 68 69 |tched,.i|t is shi|
|00004db0| 66 74 65 64 20 74 6f 20 | 74 68 65 20 72 69 67 68 |fted to |the righ|
|00004dc0| 74 20 62 79 20 74 68 65 | 20 6e 75 6d 62 65 72 20 |t by the| number |
|00004dd0| 6f 66 20 62 69 74 73 20 | 69 6e 20 74 68 65 20 73 |of bits |in the s|
|00004de0| 68 69 66 74 20 63 6f 75 | 6e 74 2e 0a 54 68 65 20 |hift cou|nt..The |
|00004df0| 68 69 67 68 20 62 69 74 | 73 20 63 6f 6d 65 20 66 |high bit|s come f|
|00004e00| 72 6f 6d 20 74 68 69 73 | 20 69 6e 74 65 72 6e 61 |rom this| interna|
|00004e10| 6c 20 64 61 74 61 20 72 | 65 67 69 73 74 65 72 2c |l data r|egister,|
|00004e20| 20 61 6e 64 20 74 68 65 | 20 6c 6f 77 20 62 69 74 | and the| low bit|
|00004e30| 73 0a 61 72 65 20 73 68 | 69 66 74 65 64 20 6f 75 |s.are sh|ifted ou|
|00004e40| 74 20 69 6e 74 6f 20 74 | 68 65 20 69 6e 74 65 72 |t into t|he inter|
|00004e50| 6e 61 6c 20 64 61 74 61 | 20 72 65 67 69 73 74 65 |nal data| registe|
|00004e60| 72 2e 20 20 49 6e 20 6f | 74 68 65 72 20 77 6f 72 |r. In o|ther wor|
|00004e70| 64 73 2c 20 74 68 65 0a | 61 6c 67 6f 72 69 74 68 |ds, the.|algorith|
|00004e80| 6d 20 6c 6f 6f 6b 73 20 | 73 6f 6d 65 74 68 69 6e |m looks |somethin|
|00004e90| 67 20 6c 69 6b 65 20 74 | 68 69 73 3a 0a 0a 5c 62 |g like t|his:..\b|
|00004ea0| 76 0a 64 6f 62 6c 69 74 | 28 61 61 64 64 72 65 73 |v.doblit|(aaddres|
|00004eb0| 73 2c 20 68 65 69 67 68 | 74 2c 20 77 69 64 74 68 |s, heigh|t, width|
|00004ec0| 2c 20 61 6d 6f 64 75 6c | 6f 2c 20 73 68 29 0a 63 |, amodul|o, sh).c|
|00004ed0| 68 61 72 20 2a 61 61 64 | 64 72 65 73 73 20 3b 0a |har *aad|dress ;.|
|00004ee0| 69 6e 74 20 68 65 69 67 | 68 74 2c 20 77 69 64 74 |int heig|ht, widt|
|00004ef0| 68 2c 20 61 6d 6f 64 75 | 6c 6f 2c 20 73 68 20 3b |h, amodu|lo, sh ;|
|00004f00| 0a 7b 0a 20 20 20 69 6e | 74 20 68 2c 20 76 20 3b |.{. in|t h, v ;|
|00004f10| 0a 20 20 20 69 6e 74 20 | 70 72 65 76 5f 64 61 74 |. int |prev_dat|
|00004f20| 61 2c 20 64 61 74 61 20 | 3b 0a 20 20 20 70 72 65 |a, data |;. pre|
|00004f30| 76 5f 64 61 74 61 20 3d | 20 30 20 3b 0a 20 20 20 |v_data =| 0 ;. |
|00004f40| 66 6f 72 20 28 76 3d 30 | 3b 20 76 3c 68 65 69 67 |for (v=0|; v<heig|
|00004f50| 68 74 3b 20 76 2b 2b 29 | 20 7b 0a 20 20 20 20 20 |ht; v++)| {. |
|00004f60| 20 66 6f 72 20 28 68 3d | 30 3b 20 68 3c 77 69 64 | for (h=|0; h<wid|
|00004f70| 74 68 3b 20 68 2b 2b 29 | 20 7b 0a 20 20 20 20 20 |th; h++)| {. |
|00004f80| 20 20 20 20 64 61 74 61 | 20 3d 20 28 28 70 72 65 | data| = ((pre|
|00004f90| 76 5f 64 61 74 61 20 3c | 3c 20 31 36 29 0a 20 20 |v_data <|< 16). |
|00004fa0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 7c 20 | | | |
|00004fb0| 2a 61 61 64 64 72 65 73 | 73 29 20 3e 3e 20 73 68 |*aaddres|s) >> sh|
|00004fc0| 20 3b 0a 20 20 20 20 20 | 20 20 20 20 70 72 65 76 | ;. | prev|
|00004fd0| 5f 64 61 74 61 20 3d 20 | 2a 61 61 64 64 72 65 73 |_data = |*aaddres|
|00004fe0| 73 20 3b 0a 20 20 20 20 | 20 20 20 20 20 66 75 6e |s ;. | fun|
|00004ff0| 63 74 69 6f 6e 28 64 61 | 74 61 29 20 3b 0a 20 20 |ction(da|ta) ;. |
|00005000| 20 20 20 20 20 20 20 61 | 61 64 64 72 65 73 73 20 | a|address |
|00005010| 2b 3d 20 32 20 3b 0a 20 | 20 20 20 20 20 7d 0a 20 |+= 2 ;. | }. |
|00005020| 20 20 20 20 20 61 61 64 | 64 72 65 73 73 20 2b 3d | aad|dress +=|
|00005030| 20 61 6d 6f 64 75 6c 6f | 20 3b 0a 20 20 20 7d 0a | amodulo| ;. }.|
|00005040| 7d 0a 24 65 6e 64 76 65 | 72 62 0a 5c 6e 6f 69 6e |}.$endve|rb.\noin|
|00005050| 64 65 6e 74 0a 53 6f 2c | 20 61 73 20 79 6f 75 20 |dent.So,| as you |
|00005060| 63 61 6e 20 73 65 65 2c | 20 74 68 69 6e 67 73 20 |can see,| things |
|00005070| 77 6f 72 6b 20 6e 69 63 | 65 6c 79 20 61 6c 6f 6e |work nic|ely alon|
|00005080| 67 20 74 68 65 20 72 6f | 77 2e 20 20 54 68 65 20 |g the ro|w. The |
|00005090| 66 69 72 73 74 20 74 69 | 6d 65 0a 61 72 6f 75 6e |first ti|me.aroun|
|000050a0| 64 2c 20 74 68 65 20 6d | 6f 73 74 20 73 69 67 6e |d, the m|ost sign|
|000050b0| 69 66 69 63 61 6e 74 20 | 62 69 74 73 20 6f 66 20 |ificant |bits of |
|000050c0| 74 68 65 20 64 61 74 61 | 20 77 6f 72 64 20 67 65 |the data| word ge|
|000050d0| 74 20 73 68 69 66 74 65 | 64 20 72 69 67 68 74 0a |t shifte|d right.|
|000050e0| 61 6e 64 20 75 73 65 64 | 2e 20 20 54 68 65 20 6e |and used|. The n|
|000050f0| 65 78 74 20 6f 70 65 72 | 61 74 69 6f 6e 20 75 73 |ext oper|ation us|
|00005100| 65 73 20 74 68 65 20 6c | 65 61 73 74 20 73 69 67 |es the l|east sig|
|00005110| 6e 69 66 69 63 61 6e 74 | 20 62 69 74 73 20 6f 66 |nificant| bits of|
|00005120| 20 74 68 65 20 70 72 65 | 76 69 6f 75 73 0a 64 61 | the pre|vious.da|
|00005130| 74 61 20 77 6f 72 64 20 | 61 6e 64 20 74 68 65 20 |ta word |and the |
|00005140| 6d 6f 73 74 20 73 69 67 | 6e 69 66 69 63 61 6e 74 |most sig|nificant|
|00005150| 20 62 69 74 73 20 6f 66 | 20 74 68 65 20 63 75 72 | bits of| the cur|
|00005160| 72 65 6e 74 20 77 6f 72 | 64 2c 20 61 73 20 69 74 |rent wor|d, as it|
|00005170| 20 69 73 0a 73 75 70 70 | 6f 73 65 64 20 74 6f 2e | is.supp|osed to.|
|00005180| 20 20 54 68 65 20 6f 6e | 6c 79 20 64 69 66 66 69 | The on|ly diffi|
|00005190| 63 75 6c 74 79 20 61 70 | 70 65 61 72 73 20 61 63 |culty ap|pears ac|
|000051a0| 72 6f 73 73 20 72 6f 77 | 73 2e 20 20 46 6f 72 20 |ross row|s. For |
|000051b0| 74 68 65 20 66 69 72 73 | 74 0a 77 6f 72 64 20 69 |the firs|t.word i|
|000051c0| 6e 20 61 20 73 75 62 73 | 65 71 75 65 6e 74 20 72 |n a subs|equent r|
|000051d0| 6f 77 2c 20 74 68 65 20 | 6c 6f 77 20 6f 72 64 65 |ow, the |low orde|
|000051e0| 72 20 62 69 74 73 20 6f | 66 20 74 68 65 20 6c 61 |r bits o|f the la|
|000051f0| 73 74 20 77 6f 72 64 20 | 69 6e 20 74 68 65 0a 70 |st word |in the.p|
|00005200| 72 65 76 69 6f 75 73 20 | 72 6f 77 20 61 72 65 20 |revious |row are |
|00005210| 75 73 65 64 2c 20 72 61 | 74 68 65 72 20 74 68 61 |used, ra|ther tha|
|00005220| 6e 20 73 68 69 66 74 69 | 6e 67 20 69 6e 20 7a 65 |n shifti|ng in ze|
|00005230| 72 6f 73 20 61 73 20 68 | 61 70 70 65 6e 73 20 6f |ros as h|appens o|
|00005240| 6e 20 74 68 65 20 66 69 | 72 73 74 0a 72 6f 77 2e |n the fi|rst.row.|
|00005250| 20 20 54 68 69 6e 67 73 | 20 73 74 61 72 74 20 74 | Things| start t|
|00005260| 6f 20 67 65 74 20 61 20 | 62 69 74 20 68 61 69 72 |o get a |bit hair|
|00005270| 69 65 72 2e 0a 0a 42 75 | 74 20 61 6c 6c 20 69 73 |ier...Bu|t all is|
|00005280| 20 6e 6f 74 20 6c 6f 73 | 74 2e 20 20 55 73 69 6e | not los|t. Usin|
|00005290| 67 20 74 68 65 20 41 20 | 72 65 67 69 73 74 65 72 |g the A |register|
|000052a0| 27 73 20 61 62 69 6c 69 | 74 79 20 74 6f 20 6d 61 |'s abili|ty to ma|
|000052b0| 73 6b 20 74 68 65 20 66 | 69 72 73 74 0a 61 6e 64 |sk the f|irst.and|
|000052c0| 20 6c 61 73 74 20 77 6f | 72 64 20 69 6e 20 61 20 | last wo|rd in a |
|000052d0| 72 6f 77 2c 20 77 65 20 | 63 61 6e 20 7a 65 72 6f |row, we |can zero|
|000052e0| 20 6f 75 74 20 61 6e 79 | 20 62 69 74 73 20 77 65 | out any| bits we|
|000052f0| 20 77 61 6e 74 2c 20 65 | 76 65 6e 20 69 66 20 77 | want, e|ven if w|
|00005300| 65 0a 74 75 72 6e 20 6f | 66 66 20 74 68 65 20 41 |e.turn o|ff the A|
|00005310| 20 44 4d 41 20 63 68 61 | 6e 6e 65 6c 2e 20 20 46 | DMA cha|nnel. F|
|00005320| 6f 72 20 69 6e 73 74 61 | 6e 63 65 2c 20 75 73 69 |or insta|nce, usi|
|00005330| 6e 67 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 73 |ng the c|urrent s|
|00005340| 65 74 74 69 6e 67 73 20 | 6f 66 0a 42 6c 69 74 4c |ettings |of.BlitL|
|00005350| 61 62 2c 20 73 65 74 20 | 74 68 65 20 6c 65 61 73 |ab, set |the leas|
|00005360| 74 20 73 69 67 6e 69 66 | 69 63 61 6e 74 20 74 68 |t signif|icant th|
|00005370| 72 65 65 20 62 69 74 73 | 20 6f 66 20 74 68 65 20 |ree bits| of the |
|00005380| 41 4c 57 4d 20 74 6f 20 | 5c 2e 7b 30 7d 2e 20 20 |ALWM to |\.{0}. |
|00005390| 28 4e 6f 74 65 0a 74 68 | 61 74 20 7b 5c 69 74 20 |(Note.th|at {\it |
|000053a0| 74 68 65 73 65 7d 20 61 | 72 65 20 74 68 65 20 62 |these} a|re the b|
|000053b0| 69 74 73 20 77 65 20 6e | 65 65 64 20 74 6f 20 6d |its we n|eed to m|
|000053c0| 61 73 6b 20 6f 75 74 3b | 20 74 68 65 20 6d 61 73 |ask out;| the mas|
|000053d0| 6b 73 20 61 72 65 20 61 | 70 70 6c 69 65 64 20 62 |ks are a|pplied b|
|000053e0| 65 66 6f 72 65 0a 74 68 | 65 20 73 68 69 66 74 69 |efore.th|e shifti|
|000053f0| 6e 67 2e 20 20 49 6e 20 | 61 64 64 69 74 69 6f 6e |ng. In |addition|
|00005400| 2c 20 74 68 65 20 46 57 | 4d 20 69 73 20 61 70 70 |, the FW|M is app|
|00005410| 6c 69 65 64 20 6f 6e 6c | 79 20 74 6f 20 74 68 65 |lied onl|y to the|
|00005420| 20 66 69 72 73 74 20 77 | 6f 72 64 20 69 6e 0a 65 | first w|ord in.e|
|00005430| 61 63 68 20 72 6f 77 3b | 20 74 68 65 20 4c 57 4d |ach row;| the LWM|
|00005440| 20 69 73 20 61 70 70 6c | 69 65 64 20 6f 6e 6c 79 | is appl|ied only|
|00005450| 20 74 6f 20 74 68 65 20 | 6c 61 73 74 20 77 6f 72 | to the |last wor|
|00005460| 64 3b 20 69 66 20 74 68 | 65 79 20 61 72 65 20 74 |d; if th|ey are t|
|00005470| 68 65 20 73 61 6d 65 0a | 77 6f 72 64 2c 20 62 6f |he same.|word, bo|
|00005480| 74 68 20 6d 61 73 6b 73 | 20 61 72 65 20 61 70 70 |th masks| are app|
|00005490| 6c 69 65 64 2e 29 20 20 | 52 65 64 6f 20 74 68 65 |lied.) |Redo the|
|000054a0| 20 62 6c 69 74 2c 20 61 | 6e 64 20 6e 6f 77 20 74 | blit, a|nd now t|
|000054b0| 68 69 6e 67 73 0a 61 70 | 70 65 61 72 20 74 6f 20 |hings.ap|pear to |
|000054c0| 62 65 20 77 6f 72 6b 69 | 6e 67 20 63 6f 72 72 65 |be worki|ng corre|
|000054d0| 63 74 6c 79 2e 0a 0a 5c | 73 65 63 74 69 6f 6e 20 |ctly...\|section |
|000054e0| 5a 65 72 6f 20 46 6c 61 | 67 5c 5c 0a 0a 59 6f 75 |Zero Fla|g\\..You|
|000054f0| 20 6d 69 67 68 74 20 68 | 61 76 65 20 6e 6f 74 69 | might h|ave noti|
|00005500| 63 65 64 20 74 68 61 74 | 20 61 66 74 65 72 20 65 |ced that| after e|
|00005510| 61 63 68 20 62 6c 69 74 | 2c 20 42 6c 69 74 4c 61 |ach blit|, BlitLa|
|00005520| 62 20 77 72 69 74 65 73 | 0a 5c 2e 7b 5a 65 72 6f |b writes|.\.{Zero|
|00005530| 20 46 6c 61 67 20 53 45 | 54 7d 20 6f 72 20 5c 2e | Flag SE|T} or \.|
|00005540| 7b 5a 65 72 6f 20 46 6c | 61 67 20 43 4c 45 41 52 |{Zero Fl|ag CLEAR|
|00005550| 7d 20 6f 6e 20 74 68 65 | 20 74 69 74 6c 65 20 62 |} on the| title b|
|00005560| 61 72 2e 20 20 41 73 20 | 74 68 65 0a 62 6c 69 74 |ar. As |the.blit|
|00005570| 74 65 72 20 72 75 6e 73 | 2c 20 69 74 20 6c 6f 6f |ter runs|, it loo|
|00005580| 6b 73 20 61 74 20 74 68 | 65 20 72 65 73 75 6c 74 |ks at th|e result|
|00005590| 20 76 61 6c 75 65 73 20 | 74 68 61 74 20 69 74 20 | values |that it |
|000055a0| 77 6f 75 6c 64 20 77 72 | 69 74 65 20 74 6f 0a 74 |would wr|ite to.t|
|000055b0| 68 65 20 44 20 63 68 61 | 6e 6e 65 6c 2c 20 69 66 |he D cha|nnel, if|
|000055c0| 20 74 68 65 20 44 20 63 | 68 61 6e 6e 65 6c 20 77 | the D c|hannel w|
|000055d0| 65 72 65 20 6f 6e 2e 20 | 20 49 66 20 61 6e 79 20 |ere on. | If any |
|000055e0| 6f 66 20 74 68 65 73 65 | 20 76 61 6c 75 65 73 20 |of these| values |
|000055f0| 61 72 65 0a 6e 6f 6e 2d | 7a 65 72 6f 2c 20 74 68 |are.non-|zero, th|
|00005600| 65 6e 20 74 68 65 20 7a | 65 72 6f 20 66 6c 61 67 |en the z|ero flag|
|00005610| 20 69 73 20 63 6c 65 61 | 72 65 64 20 61 74 20 74 | is clea|red at t|
|00005620| 68 65 20 65 6e 64 20 6f | 66 20 74 68 65 20 62 6c |he end o|f the bl|
|00005630| 69 74 2e 0a 4f 74 68 65 | 72 77 69 73 65 2c 20 74 |it..Othe|rwise, t|
|00005640| 68 65 20 7a 65 72 6f 20 | 66 6c 61 67 20 69 73 20 |he zero |flag is |
|00005650| 73 65 74 2e 20 20 54 68 | 69 73 20 63 61 6e 20 62 |set. Th|is can b|
|00005660| 65 20 75 73 65 66 75 6c | 20 66 6f 72 20 63 6f 6c |e useful| for col|
|00005670| 6c 69 73 69 6f 6e 0a 64 | 65 74 65 63 74 69 6f 6e |lision.d|etection|
|00005680| 2c 20 66 6f 72 20 69 6e | 73 74 61 6e 63 65 3b 20 |, for in|stance; |
|00005690| 73 69 6d 70 6c 79 20 60 | 61 6e 64 27 20 74 6f 67 |simply `|and' tog|
|000056a0| 65 74 68 65 72 20 79 6f | 75 72 20 6f 62 6a 65 63 |ether yo|ur objec|
|000056b0| 74 20 61 6e 64 20 74 68 | 65 0a 62 61 63 6b 67 72 |t and th|e.backgr|
|000056c0| 6f 75 6e 64 2c 20 61 6e | 64 20 69 66 20 74 68 65 |ound, an|d if the|
|000056d0| 20 7a 65 72 6f 20 66 6c | 61 67 20 69 73 20 63 6c | zero fl|ag is cl|
|000056e0| 65 61 72 2c 20 74 68 65 | 72 65 20 77 61 73 20 61 |ear, the|re was a|
|000056f0| 20 63 6f 6c 6c 69 73 69 | 6f 6e 2e 0a 0a 5c 73 65 | collisi|on...\se|
|00005700| 63 74 69 6f 6e 20 44 65 | 63 72 65 6d 65 6e 74 20 |ction De|crement |
|00005710| 4d 6f 64 65 5c 5c 0a 0a | 53 6f 6d 65 74 69 6d 65 |Mode\\..|Sometime|
|00005720| 73 20 74 68 65 20 73 6f | 75 72 63 65 20 61 6e 64 |s the so|urce and|
|00005730| 20 64 65 73 74 69 6e 61 | 74 69 6f 6e 20 6f 66 20 | destina|tion of |
|00005740| 79 6f 75 72 20 62 6c 69 | 74 73 20 77 69 6c 6c 20 |your bli|ts will |
|00005750| 6f 76 65 72 6c 61 70 2e | 20 20 49 66 0a 74 68 65 |overlap.| If.the|
|00005760| 20 64 65 73 74 69 6e 61 | 74 69 6f 6e 20 73 74 61 | destina|tion sta|
|00005770| 72 74 73 20 61 74 20 61 | 20 6c 6f 77 65 72 20 6d |rts at a| lower m|
|00005780| 65 6d 6f 72 79 20 61 64 | 64 72 65 73 73 20 74 68 |emory ad|dress th|
|00005790| 61 6e 20 74 68 65 20 73 | 6f 75 72 63 65 2c 20 65 |an the s|ource, e|
|000057a0| 76 65 72 79 74 68 69 6e | 67 0a 77 69 6c 6c 20 77 |verythin|g.will w|
|000057b0| 6f 72 6b 20 66 69 6e 65 | 2e 20 20 48 6f 77 65 76 |ork fine|. Howev|
|000057c0| 65 72 2c 20 69 66 20 74 | 68 65 20 64 65 73 74 69 |er, if t|he desti|
|000057d0| 6e 61 74 69 6f 6e 20 73 | 74 61 72 74 73 20 61 74 |nation s|tarts at|
|000057e0| 20 61 20 68 69 67 68 65 | 72 20 6d 65 6d 6f 72 79 | a highe|r memory|
|000057f0| 0a 61 64 64 72 65 73 73 | 20 61 6e 64 20 6f 76 65 |.address| and ove|
|00005800| 72 6c 61 70 73 20 61 20 | 73 6f 75 72 63 65 2c 20 |rlaps a |source, |
|00005810| 61 20 70 6f 72 74 69 6f | 6e 20 6f 66 20 74 68 65 |a portio|n of the|
|00005820| 20 73 6f 75 72 63 65 20 | 77 69 6c 6c 20 62 65 20 | source |will be |
|00005830| 6f 76 65 72 77 72 69 74 | 74 65 6e 0a 62 79 20 74 |overwrit|ten.by t|
|00005840| 68 65 20 64 65 73 74 69 | 6e 61 74 69 6f 6e 20 62 |he desti|nation b|
|00005850| 65 66 6f 72 65 20 69 74 | 20 63 61 6e 20 62 65 20 |efore it| can be |
|00005860| 75 73 65 64 20 61 73 20 | 73 6f 75 72 63 65 2c 20 |used as |source, |
|00005870| 73 6f 20 74 68 65 20 62 | 6c 69 74 20 77 69 6c 6c |so the b|lit will|
|00005880| 20 6e 6f 74 0a 70 65 72 | 66 6f 72 6d 20 61 73 20 | not.per|form as |
|00005890| 65 78 70 65 63 74 65 64 | 2e 20 20 54 68 65 20 62 |expected|. The b|
|000058a0| 6c 69 74 74 65 72 20 68 | 61 73 20 61 20 73 70 65 |litter h|as a spe|
|000058b0| 63 69 61 6c 20 66 6c 61 | 67 20 77 68 69 63 68 20 |cial fla|g which |
|000058c0| 73 6f 6c 76 65 73 20 74 | 68 69 73 0a 70 72 6f 62 |solves t|his.prob|
|000058d0| 6c 65 6d 2e 20 20 54 68 | 69 73 20 66 6c 61 67 20 |lem. Th|is flag |
|000058e0| 70 75 74 73 20 74 68 65 | 20 62 6c 69 74 74 65 72 |puts the| blitter|
|000058f0| 20 69 6e 20 74 68 65 20 | 64 65 63 72 65 6d 65 6e | in the |decremen|
|00005900| 74 20 6d 6f 64 65 2c 20 | 77 68 65 72 65 20 61 64 |t mode, |where ad|
|00005910| 64 72 65 73 73 65 73 0a | 61 72 65 20 64 65 63 72 |dresses.|are decr|
|00005920| 65 6d 65 6e 74 65 64 20 | 69 6e 73 74 65 61 64 20 |emented |instead |
|00005930| 6f 66 20 69 6e 63 72 65 | 6d 65 6e 74 65 64 20 61 |of incre|mented a|
|00005940| 73 20 74 68 65 20 62 6c | 69 74 20 70 72 6f 63 65 |s the bl|it proce|
|00005950| 65 64 73 2e 0a 54 6f 67 | 67 6c 65 20 74 68 65 20 |eds..Tog|gle the |
|00005960| 67 61 64 67 65 74 20 60 | 28 64 65 73 63 29 27 2c |gadget `|(desc)',|
|00005970| 20 69 74 20 73 68 6f 75 | 6c 64 20 62 65 63 6f 6d | it shou|ld becom|
|00005980| 65 0a 60 44 45 53 43 27 | 2c 20 69 6e 64 69 63 61 |e.`DESC'|, indica|
|00005990| 74 69 6e 67 20 74 68 61 | 74 20 69 74 20 69 73 20 |ting tha|t it is |
|000059a0| 73 65 74 2e 20 20 49 66 | 20 79 6f 75 20 75 73 65 |set. If| you use|
|000059b0| 20 74 68 69 73 20 6d 6f | 64 65 2c 20 79 6f 75 20 | this mo|de, you |
|000059c0| 6d 75 73 74 0a 69 6e 69 | 74 69 61 6c 69 7a 65 20 |must.ini|tialize |
|000059d0| 74 68 65 20 61 64 64 72 | 65 73 73 65 73 20 74 6f |the addr|esses to|
|000059e0| 20 74 68 65 20 65 6e 64 | 20 6f 66 20 74 68 65 20 | the end| of the |
|000059f0| 73 6f 75 72 63 65 20 6f | 72 20 64 65 73 74 69 6e |source o|r destin|
|00005a00| 61 74 69 6f 6e 20 62 6c | 6f 63 6b 2c 0a 61 6e 64 |ation bl|ock,.and|
|00005a10| 20 75 73 65 20 6e 65 67 | 61 74 69 76 65 20 6d 6f | use neg|ative mo|
|00005a20| 64 75 6c 6f 20 76 61 6c | 75 65 73 2e 20 20 54 68 |dulo val|ues. Th|
|00005a30| 65 20 57 20 61 6e 64 20 | 48 20 6d 75 73 74 20 73 |e W and |H must s|
|00005a40| 74 61 79 20 70 6f 73 69 | 74 69 76 65 2e 0a 54 72 |tay posi|tive..Tr|
|00005a50| 79 20 69 74 2e 20 20 54 | 75 72 6e 20 6f 6e 20 74 |y it. T|urn on t|
|00005a60| 68 65 20 41 20 61 6e 64 | 20 44 20 63 68 61 6e 6e |he A and| D chann|
|00005a70| 65 6c 73 2c 20 61 6e 64 | 20 74 75 72 6e 20 6f 66 |els, and| turn of|
|00005a80| 66 20 74 68 65 20 42 20 | 61 6e 64 20 43 2e 0a 53 |f the B |and C..S|
|00005a90| 65 74 20 74 68 65 20 41 | 20 63 68 61 6e 6e 65 6c |et the A| channel|
|00005aa0| 20 74 6f 20 5c 2e 7b 4d | 2b 31 39 30 7d 2c 20 61 | to \.{M|+190}, a|
|00005ab0| 6e 64 20 74 68 65 20 44 | 20 63 68 61 6e 6e 65 6c |nd the D| channel|
|00005ac0| 20 74 6f 20 5c 2e 7b 4d | 2b 33 38 32 7d 2e 20 20 | to \.{M|+382}. |
|00005ad0| 53 65 74 20 74 68 65 0a | 66 75 6e 63 74 69 6f 6e |Set the.|function|
|00005ae0| 20 74 6f 20 5c 2e 7b 41 | 7d 2c 20 74 68 65 20 6d | to \.{A|}, the m|
|00005af0| 6f 64 75 6c 6f 73 20 74 | 6f 20 5c 2e 7b 30 7d 2c |odulos t|o \.{0},|
|00005b00| 20 74 68 65 20 77 69 64 | 74 68 20 74 6f 20 5c 2e | the wid|th to \.|
|00005b10| 7b 36 7d 2c 20 61 6e 64 | 20 74 68 65 20 68 65 69 |{6}, and| the hei|
|00005b20| 67 68 74 0a 74 6f 20 5c | 2e 7b 31 36 7d 2e 20 20 |ght.to \|.{16}. |
|00005b30| 53 65 74 20 74 68 65 20 | 46 57 4d 20 61 6e 64 20 |Set the |FWM and |
|00005b40| 4c 57 4d 20 62 61 63 6b | 20 74 6f 20 5c 2e 7b 5c |LWM back| to \.{\|
|00005b50| 24 46 46 46 46 7d 2e 0a | 44 72 61 77 20 73 6f 6d |$FFFF}..|Draw som|
|00005b60| 65 20 72 61 6e 64 6f 6d | 20 70 61 74 74 65 72 6e |e random| pattern|
|00005b70| 20 69 6e 20 74 68 65 20 | 75 70 70 65 72 20 68 61 | in the |upper ha|
|00005b80| 6c 66 20 6f 66 20 74 68 | 65 20 72 65 63 74 61 6e |lf of th|e rectan|
|00005b90| 67 6c 65 2c 0a 69 6e 73 | 75 72 65 20 74 68 61 74 |gle,.ins|ure that|
|00005ba0| 20 74 68 65 20 44 45 53 | 43 20 66 6c 61 67 20 69 | the DES|C flag i|
|00005bb0| 73 20 73 65 74 2c 20 61 | 6e 64 20 60 47 4f 27 2e |s set, a|nd `GO'.|
|00005bc0| 20 20 49 74 20 73 68 6f | 75 6c 64 20 77 6f 72 6b | It sho|uld work|
|00005bd0| 20 61 73 20 62 65 66 6f | 72 65 2e 0a 4e 6f 77 20 | as befo|re..Now |
|00005be0| 73 65 74 20 44 20 74 6f | 20 5c 2e 7b 4d 2b 32 30 |set D to| \.{M+20|
|00005bf0| 32 7d 2c 20 61 6e 64 20 | 77 61 74 63 68 20 74 68 |2}, and |watch th|
|00005c00| 65 20 70 61 74 74 65 72 | 6e 20 73 74 65 70 20 64 |e patter|n step d|
|00005c10| 6f 77 6e 20 77 69 74 68 | 20 65 61 63 68 20 62 6c |own with| each bl|
|00005c20| 69 74 2e 0a 0a 4e 6f 74 | 65 20 74 68 61 74 20 74 |it...Not|e that t|
|00005c30| 68 65 20 62 6c 69 74 74 | 65 72 20 61 63 74 75 61 |he blitt|er actua|
|00005c40| 6c 6c 79 20 68 61 73 20 | 61 20 73 69 6e 67 6c 65 |lly has |a single|
|00005c50| 2d 73 74 61 67 65 20 70 | 69 70 65 6c 69 6e 65 20 |-stage p|ipeline |
|00005c60| 6f 6e 20 69 74 73 0a 6f | 75 74 70 75 74 2e 20 20 |on its.o|utput. |
|00005c70| 41 6c 6c 20 6f 66 20 74 | 68 65 20 73 6f 75 72 63 |All of t|he sourc|
|00005c80| 65 73 20 66 6f 72 20 74 | 68 65 20 7b 5c 69 74 20 |es for t|he {\it |
|00005c90| 6e 65 78 74 5c 2f 7d 20 | 6f 70 65 72 61 74 69 6f |next\/} |operatio|
|00005ca0| 6e 20 61 72 65 20 66 65 | 74 63 68 65 64 0a 62 65 |n are fe|tched.be|
|00005cb0| 66 6f 72 65 20 74 68 65 | 20 72 65 73 75 6c 74 20 |fore the| result |
|00005cc0| 6f 66 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 6f |of the c|urrent o|
|00005cd0| 70 65 72 61 74 69 6f 6e | 20 69 73 20 77 72 69 74 |peration| is writ|
|00005ce0| 74 65 6e 20 74 6f 20 6d | 65 6d 6f 72 79 2e 20 20 |ten to m|emory. |
|00005cf0| 54 68 69 73 0a 6d 61 6b | 65 73 20 69 74 20 70 6f |This.mak|es it po|
|00005d00| 73 73 69 62 6c 65 2c 20 | 66 6f 72 20 69 6e 73 74 |ssible, |for inst|
|00005d10| 61 6e 63 65 2c 20 74 6f | 20 6d 6f 76 65 20 61 20 |ance, to| move a |
|00005d20| 62 69 74 20 66 69 65 6c | 64 20 65 69 67 68 74 20 |bit fiel|d eight |
|00005d30| 62 69 74 73 20 6c 65 66 | 74 2c 0a 77 69 74 68 6f |bits lef|t,.witho|
|00005d40| 75 74 20 75 73 69 6e 67 | 20 64 65 73 63 65 6e 64 |ut using| descend|
|00005d50| 69 6e 67 20 6d 6f 64 65 | 2e 0a 0a 5c 73 65 63 74 |ing mode|...\sect|
|00005d60| 69 6f 6e 20 43 6f 70 79 | 69 6e 67 20 41 72 62 69 |ion Copy|ing Arbi|
|00005d70| 74 72 61 72 79 20 52 65 | 67 69 6f 6e 73 5c 5c 0a |trary Re|gions\\.|
|00005d80| 0a 57 65 20 77 69 6c 6c | 20 6e 6f 77 20 61 74 74 |.We will| now att|
|00005d90| 65 6d 70 74 20 74 6f 20 | 6d 6f 76 65 20 61 20 72 |empt to |move a r|
|00005da0| 65 63 74 61 6e 67 75 6c | 61 72 20 61 72 72 61 79 |ectangul|ar array|
|00005db0| 20 6f 66 20 62 69 74 73 | 20 66 72 6f 6d 20 6f 6e | of bits| from on|
|00005dc0| 65 20 72 61 6e 64 6f 6d | 0a 62 69 74 20 6c 6f 63 |e random|.bit loc|
|00005dd0| 61 74 69 6f 6e 20 74 6f | 20 61 6e 6f 74 68 65 72 |ation to| another|
|00005de0| 2e 0a 54 6f 20 73 65 74 | 20 74 68 69 6e 67 73 20 |..To set| things |
|00005df0| 75 70 2c 20 63 6c 65 61 | 72 20 6f 75 74 20 74 68 |up, clea|r out th|
|00005e00| 65 20 65 6e 74 69 72 65 | 20 72 65 63 74 61 6e 67 |e entire| rectang|
|00005e10| 6c 65 2e 20 20 4e 6f 77 | 2c 20 64 72 61 77 20 61 |le. Now|, draw a|
|00005e20| 6e 20 65 6c 6c 69 70 73 | 65 0a 69 6e 20 74 68 65 |n ellips|e.in the|
|00005e30| 20 75 70 70 65 72 20 68 | 61 6c 66 20 72 65 67 69 | upper h|alf regi|
|00005e40| 6f 6e 3b 20 74 72 79 20 | 74 6f 20 67 65 74 20 69 |on; try |to get i|
|00005e50| 74 20 63 6c 6f 73 65 20 | 74 6f 20 74 68 65 20 66 |t close |to the f|
|00005e60| 6f 75 72 20 62 6f 72 64 | 65 72 73 2e 0a 53 65 74 |our bord|ers..Set|
|00005e70| 20 74 68 65 20 65 6e 74 | 69 72 65 20 6c 6f 77 65 | the ent|ire lowe|
|00005e80| 72 20 72 65 67 69 6f 6e | 2c 20 61 6e 64 20 63 6c |r region|, and cl|
|00005e90| 65 61 72 20 61 6e 20 58 | 20 61 63 72 6f 73 73 20 |ear an X| across |
|00005ea0| 74 68 65 20 65 6e 74 69 | 72 65 20 72 65 67 69 6f |the enti|re regio|
|00005eb0| 6e 2e 0a 57 65 20 73 68 | 61 6c 6c 20 61 74 74 65 |n..We sh|all atte|
|00005ec0| 6d 70 74 20 74 6f 0a 6d | 6f 76 65 20 74 68 65 20 |mpt to.m|ove the |
|00005ed0| 70 6f 72 74 69 6f 6e 20 | 6f 66 20 74 68 65 20 65 |portion |of the e|
|00005ee0| 6c 6c 69 70 73 65 20 66 | 72 6f 6d 20 62 69 74 20 |llipse f|rom bit |
|00005ef0| 70 6f 73 69 74 69 6f 6e | 73 20 32 20 74 68 72 6f |position|s 2 thro|
|00005f00| 75 67 68 20 32 38 20 74 | 6f 20 62 69 74 0a 70 6f |ugh 28 t|o bit.po|
|00005f10| 73 69 74 69 6f 6e 73 20 | 31 33 20 74 68 72 6f 75 |sitions |13 throu|
|00005f20| 67 68 20 33 39 20 69 6e | 20 74 68 65 20 64 65 73 |gh 39 in| the des|
|00005f30| 74 69 6e 61 74 69 6f 6e | 2c 20 6c 65 61 76 69 6e |tination|, leavin|
|00005f40| 67 20 61 6c 6c 20 74 68 | 65 20 6f 74 68 65 72 20 |g all th|e other |
|00005f50| 62 69 74 73 0a 69 6e 20 | 74 68 65 20 64 65 73 74 |bits.in |the dest|
|00005f60| 69 6e 61 74 69 6f 6e 20 | 75 6e 63 68 61 6e 67 65 |ination |unchange|
|00005f70| 64 2e 20 20 54 68 65 20 | 73 6f 75 72 63 65 20 73 |d. The |source s|
|00005f80| 70 61 6e 73 20 6f 6e 6c | 79 20 74 77 6f 20 77 6f |pans onl|y two wo|
|00005f90| 72 64 73 2c 20 62 75 74 | 0a 74 68 65 20 64 65 73 |rds, but|.the des|
|00005fa0| 74 69 6e 61 74 69 6f 6e | 20 73 70 61 6e 73 20 74 |tination| spans t|
|00005fb0| 68 72 65 65 2c 20 73 6f | 20 74 68 65 20 62 6c 69 |hree, so| the bli|
|00005fc0| 74 20 77 69 64 74 68 20 | 6d 75 73 74 20 62 65 20 |t width |must be |
|00005fd0| 33 2e 20 20 46 6f 72 20 | 73 6f 6d 65 0a 6f 74 68 |3. For |some.oth|
|00005fe0| 65 72 20 62 6c 69 74 73 | 2c 20 74 68 65 20 73 6f |er blits|, the so|
|00005ff0| 75 72 63 65 20 6d 69 67 | 68 74 20 73 70 61 6e 20 |urce mig|ht span |
|00006000| 6d 6f 72 65 20 77 6f 72 | 64 73 20 74 68 61 6e 20 |more wor|ds than |
|00006010| 74 68 65 20 64 65 73 74 | 69 6e 61 74 69 6f 6e 3b |the dest|ination;|
|00006020| 0a 74 68 65 20 77 69 64 | 74 68 20 6d 75 73 74 20 |.the wid|th must |
|00006030| 61 6c 77 61 79 73 20 62 | 65 20 74 68 65 20 6d 61 |always b|e the ma|
|00006040| 78 69 6d 75 6d 20 6f 66 | 20 74 68 65 20 74 77 6f |ximum of| the two|
|00006050| 2e 20 20 53 6f 20 73 65 | 74 20 74 68 65 20 77 69 |. So se|t the wi|
|00006060| 64 74 68 20 74 6f 0a 5c | 2e 7b 33 7d 2c 20 61 6e |dth to.\|.{3}, an|
|00006070| 64 20 61 6c 6c 20 6d 6f | 64 75 6c 6f 73 20 74 6f |d all mo|dulos to|
|00006080| 20 5c 2e 7b 36 7d 2e 0a | 0a 54 68 65 20 41 20 63 | \.{6}..|.The A c|
|00006090| 68 61 6e 6e 65 6c 20 69 | 73 20 67 6f 69 6e 67 20 |hannel i|s going |
|000060a0| 74 6f 20 66 75 6e 63 74 | 69 6f 6e 20 61 73 20 61 |to funct|ion as a|
|000060b0| 20 6d 61 73 6b 2e 20 20 | 57 68 65 72 65 76 65 72 | mask. |Wherever|
|000060c0| 20 74 68 65 20 62 69 74 | 20 69 6e 20 74 68 65 0a | the bit| in the.|
|000060d0| 41 20 63 68 61 6e 6e 65 | 6c 20 69 73 20 73 65 74 |A channe|l is set|
|000060e0| 2c 20 77 65 20 77 69 6c | 6c 20 63 6f 70 79 20 74 |, we wil|l copy t|
|000060f0| 68 65 20 73 6f 75 72 63 | 65 20 74 6f 20 74 68 65 |he sourc|e to the|
|00006100| 20 64 65 73 74 69 6e 61 | 74 69 6f 6e 3b 20 77 68 | destina|tion; wh|
|00006110| 65 72 65 20 74 68 65 0a | 62 69 74 73 20 61 72 65 |ere the.|bits are|
|00006120| 20 63 6c 65 61 72 2c 20 | 74 68 65 20 64 65 73 74 | clear, |the dest|
|00006130| 69 6e 61 74 69 6f 6e 20 | 6d 75 73 74 20 6e 6f 74 |ination |must not|
|00006140| 20 62 65 20 63 68 61 6e | 67 65 64 2e 0a 54 68 65 | be chan|ged..The|
|00006150| 20 42 20 63 68 61 6e 6e | 65 6c 20 77 69 6c 6c 20 | B chann|el will |
|00006160| 62 65 20 75 73 65 64 20 | 74 6f 20 61 63 74 75 61 |be used |to actua|
|00006170| 6c 6c 79 20 66 65 74 63 | 68 20 74 68 65 20 73 6f |lly fetc|h the so|
|00006180| 75 72 63 65 20 62 69 74 | 73 2c 0a 74 68 65 20 43 |urce bit|s,.the C|
|00006190| 20 63 68 61 6e 6e 65 6c | 20 77 69 6c 6c 0a 72 65 | channel| will.re|
|000061a0| 61 64 20 74 68 65 20 64 | 65 73 74 69 6e 61 74 69 |ad the d|estinati|
|000061b0| 6f 6e 2c 20 62 65 63 61 | 75 73 65 20 77 65 20 77 |on, beca|use we w|
|000061c0| 69 6c 6c 20 6e 65 65 64 | 20 74 6f 20 6d 65 72 67 |ill need| to merg|
|000061d0| 65 20 74 68 65 20 64 65 | 73 74 69 6e 61 74 69 6f |e the de|stinatio|
|000061e0| 6e 0a 77 69 74 68 20 74 | 68 65 20 6e 65 77 20 73 |n.with t|he new s|
|000061f0| 6f 75 72 63 65 20 62 65 | 66 6f 72 65 20 77 72 69 |ource be|fore wri|
|00006200| 74 69 6e 67 2c 20 61 6e | 64 20 74 68 65 20 44 20 |ting, an|d the D |
|00006210| 63 68 61 6e 6e 65 6c 20 | 77 69 6c 6c 20 64 6f 20 |channel |will do |
|00006220| 74 68 65 20 77 72 69 74 | 69 6e 67 2e 0a 53 6f 2c |the writ|ing..So,|
|00006230| 20 73 65 74 20 74 68 65 | 20 42 20 61 64 64 72 65 | set the| B addre|
|00006240| 73 73 20 74 6f 20 5c 2e | 7b 4d 7d 20 61 6e 64 20 |ss to \.|{M} and |
|00006250| 74 68 65 20 43 20 61 6e | 64 20 44 20 61 64 64 72 |the C an|d D addr|
|00006260| 65 73 73 65 73 20 74 6f | 20 5c 2e 7b 4d 2b 31 39 |esses to| \.{M+19|
|00006270| 32 7d 2e 20 20 54 75 72 | 6e 0a 6f 66 66 20 74 68 |2}. Tur|n.off th|
|00006280| 65 20 41 20 63 68 61 6e | 6e 65 6c 2c 20 62 75 74 |e A chan|nel, but|
|00006290| 20 74 75 72 6e 20 61 6c | 6c 20 74 68 72 65 65 20 | turn al|l three |
|000062a0| 6f 74 68 65 72 73 20 6f | 6e 2e 20 20 53 65 74 20 |others o|n. Set |
|000062b0| 74 68 65 20 41 20 64 61 | 74 61 20 74 6f 0a 5c 2e |the A da|ta to.\.|
|000062c0| 7b 5c 24 46 46 46 46 7d | 20 61 6e 64 20 74 68 65 |{\$FFFF}| and the|
|000062d0| 20 42 20 73 68 69 66 74 | 20 74 6f 20 5c 2e 7b 31 | B shift| to \.{1|
|000062e0| 31 7d 2e 20 20 4e 6f 74 | 65 20 74 68 61 74 20 77 |1}. Not|e that w|
|000062f0| 65 20 61 72 65 20 75 73 | 69 6e 67 20 74 68 65 20 |e are us|ing the |
|00006300| 41 20 63 68 61 6e 6e 65 | 6c 0a 61 73 20 61 20 63 |A channe|l.as a c|
|00006310| 6f 6e 73 74 61 6e 74 3b | 20 65 76 65 6e 20 74 68 |onstant;| even th|
|00006320| 6f 75 67 68 20 69 74 20 | 69 73 20 61 20 63 6f 6e |ough it |is a con|
|00006330| 73 74 61 6e 74 2c 20 74 | 68 65 20 6d 61 73 6b 20 |stant, t|he mask |
|00006340| 72 65 67 69 73 74 65 72 | 73 20 77 69 6c 6c 0a 73 |register|s will.s|
|00006350| 74 69 6c 6c 20 6d 61 73 | 6b 20 6f 75 74 20 62 69 |till mas|k out bi|
|00006360| 74 73 20 6f 66 20 74 68 | 61 74 20 63 6f 6e 73 74 |ts of th|at const|
|00006370| 61 6e 74 2e 0a 0a 4e 6f | 77 20 77 65 20 6e 65 65 |ant...No|w we nee|
|00006380| 64 20 74 6f 20 66 69 67 | 75 72 65 20 6f 75 74 20 |d to fig|ure out |
|00006390| 68 6f 77 20 77 65 20 61 | 72 65 20 67 6f 69 6e 67 |how we a|re going|
|000063a0| 20 74 6f 20 67 65 74 20 | 41 20 74 6f 20 6d 61 73 | to get |A to mas|
|000063b0| 6b 20 6f 75 74 20 6f 6e | 6c 79 0a 74 68 6f 73 65 |k out on|ly.those|
|000063c0| 20 62 69 74 73 20 77 65 | 20 6e 65 65 64 20 74 6f | bits we| need to|
|000063d0| 20 63 68 61 6e 67 65 2e | 20 20 53 69 6e 63 65 20 | change.| Since |
|000063e0| 6f 75 72 20 64 65 73 74 | 69 6e 61 74 69 6f 6e 20 |our dest|ination |
|000063f0| 69 73 20 74 68 65 20 6f | 6e 65 20 77 68 69 63 68 |is the o|ne which|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.